Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JQuery - .attr() not working

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
Still struggling with fancybox and looking for a work around. At this point, I am attempting to change the height property of a layer using

Code:
function resizefancy(newheight) {
[indent]$(".fancybox-inner").attr({ height: newheight });[/indent]
}

I do not get any visible errors but yet, the layer remains intact and does not resize ... what can I possibly be doing wrong?





--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Is height an attribute and not a style? To change things like height I would usually use the $(elem).css() method

Or for fancybox rather than a normal element you can set the height options in the constructor $(elem).fancybox({height:whatever})

Or if you just want to resize the box for the current content you can call $.fancybox.update()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top