0

I am using the Orbit Jquery Plugin from the ZURB Foundation and I was wondering if there was a way to auto-detect the width without having to include an a href="" link. As far as I can tell, the plugin detects the width from the a element and calculates width and height based on this. Is there a way to detect width and height without having to use an a element?

I put the code up on jsfiddle, though it is hardly functional there.

http://jsfiddle.net/jhoffm34/36vqb/1/

I'm still new to this, but wondering if there is a simple way to achieve this.

Jason Hoffmann
  • 635
  • 2
  • 7
  • 15

1 Answers1

0

in jQuery, you can detect the width with .width()

 var ratio=1/5; // 
 var height=$('img:first','#sliderfeatured').width()*ratio; // grab the first img width
 // or var height = $('img:first', '#sliderfeatured').attr('width')*ratio;
mica
  • 460
  • 3
  • 11