How to make jquery galleryview click-able? -
i using http://spaceforaname.com/galleryview/,
i need insert link every picture added link below doesn't work. there anyway can click on image jump somewhere?
<ul id="mygallery"> <li><a href="#"><img src="http://www.spaceforaname.com/galleryview/img/photos/bp1.jpg" alt="lone tree yellowstone" /></a> <li><a href="#"><img src="http://www.spaceforaname.com/galleryview/img/photos/bp1.jpg" alt="lone tree yellowstone" /></a> </ul>
you have modify .js of galleryview:
below line 22 of jquery.galleryview-3.0-dev.js, insert these lines:
this.customlink = img.attr('customlink');
this.haslink = img.attr('haslink');
next, below line 467, insert following lines:
var address = "'" + gvimage.customlink + "'";
var js = "window.location.assign(" + address + ");";
if(gvimage.haslink=='true') {img.attr("onclick", js);}
the html code triggers galleryview follows:
<ul id="mygallery">
<li><img haslink="true" customlink="somelink" src="images/1.jpg" alt="lone tree yellowstone" />
<li><img haslink="true" customlink="somelink" src="images/2.jpg" alt="lone tree yellowstone" />
</ul>
if want treat image of gallery link, set "haslink=true
". "customlink
" attribute used in same way "href
" attribute. can surround ul
div
, style "cursor:hand;cursor:pointer;
" user realizes image link.
hope helps!
Comments
Post a Comment