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:

  1. below line 22 of jquery.galleryview-3.0-dev.js, insert these lines:

    this.customlink = img.attr('customlink');
    this.haslink = img.attr('haslink');

  2. 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);}

  3. 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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -