Dash - Setting nav bar for the dashboard Application - python-3.x

I am building a Dashboard using Python Dash. I am using Materialize.css Framework for css. I want to create a Navigation Bar which the Unordered List must be shown on any devices either Mobile, Desktop. I am referring to this website Extended Nav Bar with Tabs. How do I get the webpage more responsive?
The sample code is posted here
layout = html.Div(id='main-page-content',children=[
#nav wrapper starts here
html.Div(
children=[
#nav bar
html.Nav(
#inside div
html.Div(
children=[
html.A(
'Dashboard Analytics',
className='brand-logo',
href='/'
),
#ul list components
html.Ul(
children=[
html.Li(html.A('Configuration', href='/apps/config')),
html.Li(html.A('Segmentation', href='/apps/segmentation')),
html.Li(html.A('Main Page', href='/apps/users')),
],
id='nav-mobile',
className='right hide-on-med-and-down'
),
],
className='nav-wrapper'
),style={'background-color':'#008EFE'}),
],
className='navbar-fixed'
),
])
#define the external urls
external_css = ['https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css']
for css in external_css:
app.css.append_css({'external_url': css})
external_js = ['https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js']
for js in external_js:
app.scripts.append_script({'external_url': js})
when I view the webpage in mobile the options must be shown in Side Navigation. So I can navigate through different pages without actually going back in mobile devices.

In the link you gave, the example contains the following element, which is missing from your layout:
<i class="material-icons">menu</i>
This is the button that opens the menu on mobile devices. Specifically, the data-target property is essential, as it triggers the on-click event.
Unfortunately, there is currently no easy way in Dash to add this attribute to an HTML element (see this thread).
In addition, you forgot to give the nav element the class name 'nav-extended', but I don't know how essential that is.

Related

wordpress css background color in a specific page only

I am editing a site in wordpress acting on custom css. I would need to have a black background on the main page where all the products are displayed and keep the white background inside the product sheet.
currently I have entered this code:
.site-container {
position:relative;
background:black;
}
this code worked in the main product grid, now the background is black, the problem is that it also changed the background of the single product page. how do i exclude the command to make it stay only on the product grid?
or alternatively which code should I enter to make the product sheet background white?
(the site I'm working on is not online yet)
thank you
Just add the background property to the page ID class for the page you want to change the background.
So for example your page ID is 6:
.page-id-6 {
background:black;
}
This css is only applied to the page with the ID 6.
You can find the id with the dev tools of your browser, just have a look at the classes of the HTML Body.

Display:flex and flex-wrap:wrap not working in Internet Explorer

I needed a way to get our website's product search results (divs) to all be given the same height as the other divs in the row. Since our product results have different title lengths, I cannot set a static height for each div, so I decided to use display:flex and flex-wrap:wrap on the parent div of our search result divs (#result-info-detail).
This method works great on Chrome and Firefox but unfortunately does not work well on Internet Explorer, and effectively renders poorly and prevents the page from being mobile responsive. I'm using IE11. Looking for a solution to this issue. Thanks!
Our search page: http://www.theexecutiveadvertising.com/Results.aspx?keyword=pen
I used a third party CSS Browser Selector to specifically target IE users only: http://ridjohansen.github.io/css_browser_selector/index_en.html
I gave my product results static heights at various browser widths (using media queries) and used display: inline-block instead of display: flex, because it is not supported in IE.

Turn Off 'More Options' In The Azure Media Player

How do I turn off or hide the "More Options" item in the Azure Media Player controls menu?
I still need the other controls, so disabling the entire control bar is not an option.
Currently Azure Media Player does not have any API to turn off the more options menu as it is used to house the buttons when the control bar is too small to correctly display this.
You can however hide this button with some simple CSS:
<style>
.amp-moreoptions-control{
display:none;
}
</style>
You can also add new ideas or requests for Azure Media Player here:
http://feedback.azure.com/forums/293565-azure-media-player
Pass a custom plugins > controlBarIcons object on the amp consturctor options works well too, like:
plugins: {
controlBarIcons: {
leftIcons: ["playToggle", "previousTrackButton", "skipBackwardButton", "rewindButton", "fastForwardButton", "skipForwardButton", "nextTrackButton", "playbackSpeedButton", "liveDisplay"],
middleIcons: ["liveIndicator", "currentTimeDisplay", "timeDivider", "durationDisplay", "volumeMenuButton"],
rightIcons: ["shareButton", "castToDeviceButton", "audioTracksButton", "subtitlesButton", "captionsButton", /*"qualityButton",*/ /*"moreOptionsButton",*/ "fullscreenToggle"],
removeOtherIcons: ["qualityButton", "moreOptionsButton"]
},
}
You must put the icons that u don't want to be displayed on the "removeOtherIcons", futhermore this allow you to change the order or or move the icons to other bars.

how to built 300px sidebar with html content and inject into current page in chrome extension

I would like my Chrome extension to be able to inject a 300px sidebar along with data on the right side of any page when it is activated. I am looking for the best way to build the sidebar along with its HTML content.
I am able to do some small changes to the current page using contentscript.js file, but I don't know how to build entire HTML content and display it as a sidebar.
I built the sidebar using the following code in the content script file:
sidebar = $("<div id='sidebar'></div>");
sidebar.css({
'position': 'fixed',
'right': '0px',
'top': '0px',
'z-index': 9999,
'width': '290px',
'height': '100%',
'background-color': 'blue' // Confirm it shows up
});
$('body').append(sidebar);
Now my question is how to build the HTML content for that sidebar?
You can inject a Javascript code that create a bar Example this developer "Proper Menubar" creates this. With a click it enable/disable the menubar on the top of Google website.
https://chrome.google.com/webstore/detail/proper-menubar/egclcjdpndeoioimlbbbmdhcaopnedkp

Dynamic SharePoint web part width and height

I am trying to dynamically adjust the width and height of a web part in a SharePoint web part page so that it fills up the entire available space. It appears that there is no way to choose a percentage for width and height from the web part property editor window in SharePoint. Also, trying to dynamically set it on the web part instance through code results in SharePoint throwing an exception to the effect that proportional dimensions are not supported.
Is there any way to do this using, for example, Javascript? I've seen similar things done using jQuery, but not exactly what I'm looking for (and I'm not familiar enough with jQuery to come up with something on my own).
There is a web part available that does this here. You can also see a solution on TechNet communities from "potta vijay kumar" (where I found that web part too):
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('contentpage').contentWindow.
document.body.scrollHeight;
//change the height of the iframe
document.getElementById('contentpage').height=
the_height;
}
contentpage is the ID of the iframe.
A jQuery solution is available from EndUserSharePoint.
Here's what I did:
I had an iFrame inside the middle webpart, where I will be loading webpages based on the left web part menu. So I took the <td> element where both the webparts are placed (its a <td> element with class set as ms-bodyareaframe)
var head=$('td.ms-bodyareaframe');
$("#myFrame").height(head.position.height()).attr('src',unescape(loc));
$("#myFrame").parent().height(head.height()-50);
This will perfectly re-size the webpart where the iframe resides.
Note: this may not work in all cases

Resources