开发者

dynamically resize images w/ jquery

I'm using a script that uses DD's Ultimate Fade-in Slideshow: http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

It uses jquery, and I would like to resize the images to the slideshow size.

Thank开发者_高级运维s!


If you want to animate the size of the images you can use:

jQuery('#imgID').animate({
  width: newwidth,
  height: newheight
});

or if you don't want to animate the resizing just use

jQuery('#imgID').css({'width':'newwidth', 'height':'newheight'});

newheight and newwidth would be integers of whatever dimensions you want to give it. i.e. 100px x 200px


I figured it out:

fadeSlideShow.routines={

getSlideHTML:function(imgelement){
    var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" target="'+imgelement[2]+' ">\n' : '' //hyperlink slide?
    layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0; width: 440px;" />\n'

I just added a width to the style call...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜