bxslider is hidden, but on window resize appears - ajax

I have bxslider on my php file that is loaded with ajax. and when i open page slider is hidden, nothing is shown, but when i resize window or click on inspect element slider appears and works correctly.

The reason for this is that the moment the function is called it does not find the element or even if it doesn find it, its not able to calculate height properly because the element might be getting loaded AFTER the bxSlider call or maybe hidden or something like that. But when you resize the window (or inspect element, they both fire window.resize) bxSlider is coded to respond to that and readjust its height and width, thus displaying your slider.
I hope it helps you.

Related

Add event listener when a `<div>` tag changes size on screen

There's a collapsible sidebar on my webpage. When I collapse it, I want the svg element on the page to resize to take up all of the new blank space.
The function that resizes the svg is working. However, it is not being triggered when the sidebar is collapsed.
I have tried:
d3.select("#mydivHoldingSVG").on("resize", MyResize)
Where #mydivHoldingSVG is a <div> and MyResize is the function to resize the svg.
When the sidebar is collapsed, the <div> element increases in size (as inspected via Google Chrome developer view), which I thought constituted a "resize".
If the window is resized, that is, if I use:
d3.select(window).on("resize", MyResize)
Then the svg resizes correctly.
I have looked at the list of standard events to see if one can be applied to the div element (#mydivHoldingSVG) but I'm not seeing an obvious "when a div element changes" event.
Is there an eventListener that can be added on a <div> element being resized or changed?
The gist is that you should do it another way: the resize event only pertains to the window and will not fire on any other element.
The cleanest way to solve this problem would be call MyResize when you call whatever function is collapsing your sidebar, rather than trying to indirectly listen for the sidebar being collapsed.

Highslide: Shrink image back when clicking in outer area

The only thing which I disklike whith highslide is the fact that when I click a thumbnail and it gets bigger I only can shrink it back when I click exactly in the image area.
Is it possible to shrink the image back when clicking outside the image area?
(and optional also shrink it back when I hover outside the image with the mouse cursor?)
Thanks
If you use a dimming background (hs.dimmingOpacity=0.7, for example), clicking outside the image area will close the expander. This requires highslide-full.js. If you don't want a dimming background, just set the opacity to a tiny value, like hs.dimmingOpacity=0.01.
It might be possible to include an onAfterExpand event to close the expander when you hover outside the image, but I think I can guarantee that you wouldn't like it. If a visitor clicked on a thumbnail, but didn't just happen to have his mouse over the image when it opened, it would immediately close again. That would be very frustrating behavior for the site visitor.

dojo Show/Hide One ContentPane While Another ContentPane Is Liquid

I've been struggling for weeks trying to crack this nut so I'm not sure if it's impossible, or if it's my lack of coding chops... or both. I'm not a programmer and I'm a newbie to Dojo Toolkit.
I have a site using the BorderContainer layout. I'm trying to create an effect where I can use a button to open and close a dropdown type box that will contain controls. I need this dropdown to be hidden on page load, and then open when you click the button.
My problem is that when I open the dropdown, it pushes the content pane below it off the bottom of the browser window. I need the lower ContentPane to stay fit within the remaining space of the browser window when the dropdown opens. Additionally, I want the dropdown to sit outside of the scrollable container for the content below it, which is why I have it set up to sit outside a nested BorderContainer below it.
I've created a simplified version of the code to demonstrate my challenge (see link below). If you load the page you can see the center ContentPane scrolls the content. But, if you then click on the button, a dropdown div expands above the content. Then when you scroll, you'll notice that you can't see the full pane because it's in no-man's-land below the bottom of the browser window. I assume that because the div is set to display:none on load, it's size is not accounted for on page load. Then, when you open it by pressing the button, it's size is additive and the pane below doesn't know how to resize or account for the new element.
I've tried using the visibility attribute, but that leaves a gap for the div when it's still closed. I've tinkered with some code that controls the height that shows promise, but each of my dropdown boxes will be different sizes so I'd prefer that the height be set to "auto" rather than a specified pixel size.
Does anyone have any idea how I can accomplish this so that the lower pane will fit in the space without pushing off the screen?
Here's a sample of the page:
http://equium.com/scaffold.html
(I had some problems trying to insert the full HTML page here as a code sample so if that's a preferable way to handle it, and someone can let me know the best way to embed all of that code, I'd appreciate it.)
Thanks is advance, I'd really apprecaite anyone's feedback.
You might want to take a look at dojox.layout.ExpandoPane (though be warned I think it has only worked properly for top and left regions for a while).
Also, I'd suggest simplifying/altering your layout a bit. See example here:
http://jsfiddle.net/taFzv/
(It'd probably need some tweaking to get exactly what you want.)
The real issue you're having is probably that the BorderContainer has no idea that parts of the view resized. ExpandoPane takes care of that by telling the BorderContainer to re-layout after its animation completes.
It works under IE8.0. When dropdown box open, just keep pressing mouse from page and drag to bottom, you could see the content was pushed to out of page. It looks the browser could not detect it and could not add it to "scroll bar" account.
I would suggest taking out all BorderContainers except your top level one, the one with mainPage as the id.
Place your {stuff here} div into the mainPage BorderContainer, after the ContentPane with the Close/Open button. Make sure you make it dojotype dijit.layout.ContentPane, set up layoutpriority, and set region to top. Set the height to 0/x when clicking the Open/Close button, instead of setting display.
Try your page again. If that doesn't fix it, you probably need, a call to layout, resize, or both to indicate to the BorderContainer that it needs to evaluate all its children and size the "center" pane properly. Something like dijit.byId("mainPage").layout(); Do this any time someone presses the Close/Open button, after you have changed the height of any BorderContainer children.
Maybe the dijit.form.DropDownButton would fit your needs. When click the button a tooltip is displayed that can be filled with any content you want. Just as you specified, the dropdown tooltip is only displayed when you click the button, and it doesn't mess with the underlying layout at all. The tooltip sits "on top" of the page.

Sticky XUL toolbar button

As I can see, addon-bar in FireFox 4 is a toolbar and close icon is a button. And despite the fact that toolbar is customizable (customizable="true") it is impossible to remove that button or even move it to another place.
How is it done?
I think if you overlay the element directly on to the toolbar (rather than the toolbarpalette, which is what you normally do) then you won't be able to move it unless you set the removable="true" attribute on the element.
You can remove the button (I haven't tried moving it around).
I used Dom Inspector addon: https://addons.mozilla.org/en-US/firefox/addon/dom-inspector-6622/
Notice that close button is gone on the screenshot.
I did this manually through Dom Inspector - added that attribute hidden = true. Your button id is addonbar-closebutton so from chrome (chrome overlay) you should be able to do something like: document.getElementById('addonbar-closebutton').hidden = true. This is off the top of my head so maybe it isn't the most accurate but should be simple as that.
If you want to move it I suppose you can try reordering children, or mess with styling, that toolbarspring I think is keeping it on the left and the rest of it on the right.

Jquery Jqmodal window IE position

I fixed the way the content was being pushed down with using the +position:absolute !important; hack that i've found. But now my question is no matter how i style the top (in the jqmWindow in IE it still seems to popup the window in the middle of the page. In FF however i've gotten the page to be more towards the top. The reason why i need to move this jqm window is that there is more info on the div (jqm) then will fit on the screen. Is there a way just to make the window a certain size and have scroll bars on the side if the content is larger? Thanks for the help.
you should be able to wrap the contents of the window in a div and set it's height, as well as overflow
div.wrap{
height:220px;
overflow:scroll;
}

Resources