JQuery :: Passing An Element To An Event (resize Control Upon Window Resize)?
May 31, 2011
var proportionalizedImages=new Array();
I'm wondering if there's a more elegant way to do this in jQuery. I've played around with it a bit, but i'm unsure how to get the control object to the resize function triggered by window resize without a global variable.
Im using the cycle plugin trying to make a banner slide tha is 100% the width of the window, my problem is that when i resize de window the banner does not align center, it stays somo what left align. So is there a way to keep the slides align center after you resize the window usingthe cycle plugin? or is there another plugin that i can do that? I attached a image to ilustrate, the white banner with the cat should align center when i resize the windows but it stays left align.
I'm trying to scale the text with the size of the window (I've also got all the layout sizes in ems, so this should keep the aspect ratio of everything the same as the window is resized). The code that I've got at the moment doesn't do anything -
I am using Ben Alman's JQuery resize plugin in order to obtain the varying computed width of an element when the window is resized (the element in question is a page wrapper that exhibits the expand-to-fit behavior of a block box, and it's computed width is obviously influenced by the resizing of the window. Essentially, what I need to be able to do, is to reference a variable that is defined in a .resize() function ('width_page') in a seperate .each() function.
I now understand that variables can't cross boundaries like in the example above, which leaves me a little stuck. I also understand that this is specific to the context of the .resize() function, and that it can't be taken out of it without using an element selector. Is there some way I can call the .resize() function in my .each() function?
I'm basically creating a script that wiill move a div from one place to another based on the width of the browser. The script I've made does do this however I wanted to fade to old position out then fade the new one in and this is where i got into trouble. The div just keeps flashing, i'm sure that it's something really simple that with expirience would easily be solved.
Basically I created a nice Jquery function to resize a window to the content on an Iframe. Because the Iframe has PHP in it which pulls a list of stockists and Iframes dont Auto resize to fit its contents if it pulls extra info.
So this bit of code is embedded into my Iframe, all its suppose to do is get the documents (the Iframe's) current height then it selects the parent document ( the one containing the Iframe ) then it basically adds the height to the attributes.
THE PROBLEM: It works great, the first time you use it. BOOYAKASHAA. However when you click a another stockist on the list. A smaller list for example... it keeps the height of the document really big. So it initially makes the space bigger to accomadate the list. But does not go smaller afterwards?
I've been reading forum posts (not just on this site) and unsuccessfully trying to apply the examples to what I'm doing for hours now. Can anyone help me do this correctly?
I need the browser window's resize event to trigger resizes on different objects on my page. The objects are added dynamically, so I can't just have one function to set it all up at the beginning, although so far that's the only way I know how to do it. I understand that using this method (below), that there can be only one such statement, but I need to add new functions to the resize event as I add new items to my page.
I'm using serialscroll jquery plugin from ariel Flesler on this page : http://goo.gl/HMNUX the width of the container (#slideshow) is 100% of the window's width. everything is fine until the user resize the window. Then the pictures are not in the right position anymore. should reset the "offset" setting of the plugin on resize. I tried this, but it doesn't work :
I need an event that checks if the size of a DIV has changed. The "resize" event works in IE but not in FF. Or, more precisely, The "resize" event works in FF but NOT for resizing DIVs. Is there an event that works like the "resize" event but also can be used in with DIVs in FF?
I have a site that I'm building at [URL] which use the jquery cycle plugin for a slideshow. I won't post the code here because it's all there with view source at the above address. It's a work in progress. The slideshow is full width (the images in it are actually 2000px wide but looks full width), and works fine apart from when the browser window is resized. This is most noticable when you start with a smaller browser window and then resize it to be bigger.
The slides stay the same width as when the page loaded - I need them to adapt to the new width. I need the slideshow to be centered at all widths, so I've put the images in as backgrounds to divs with center positioning on them. I've tried getting the window width on resize and then applying it to the slides using jQuery, but the original calculated size overrides it when the slide changes.