Dynamically resize images w / jquery

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

It uses jquery, and I would like to resize images to the size of a slide show.

Thank!

+3
source share
2 answers

I understood:

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 width to the style call ...

0
source

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

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

or if you do not want to animate resizing just use

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

newheight and newwidth will be integers of any dimensions you want to give. i.e. 100px x 200px

+1
source

Source: https://habr.com/ru/post/1754684/


All Articles