SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Unable to separate class elements for hack

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unable to separate class elements for hack

    here is my page http://www.philipdusel.com/gyp.html

    My initial issue was trying to fix the scrolling behavior, (the next and prev buttons should cause the scrollbar to show the image selected. there is an issue with the next button. it hides the selected image from view. being completely ignorant of java i couldnt fix it .

    but i realized that the "a.advance-link" carries the proper behaviour(ie it doesnt hide selected image from view) so i thought i could add an "a.advance-link" class to the next arrow to make up for this problem. but i have no idea how to move this class around. i tried wrapping the "controlls" div with a "advance-link" class but no luck. i tried moving around portions of the java. but i am brain dead in that dept.

    here is the little bit o script
    jQuery(document).ready(function($) {
    // ScrollTo modification
    $(' .prev, .advance-link,').live('click', function() {
    var href = $(this).attr('href');
    $('ul.thumbs').scrollTo($('.thumb[href=' + href + ']'), {axis: 'y'});
    });
    all i need to do is make "advance-link" the same size as the next butoon and position it right over and everything will be great. but i cant for the life of me figure out how to move it independently of the main image.

    Thank you

  2. #2
    It's all Geek to me silver trophybronze trophy
    SitePoint Award Recipient ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    19,968
    Mentioned
    216 Post(s)
    Tagged
    2 Thread(s)
    I must confess that I've read your post several times, and looked at the page in question, and I have absolutely no idea what your question is. If you care to rephrase it, that would be great.

    Off Topic:

    Make sure to call it JavaScript, not Java—as Java is a totally different language.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hahaha im not surprised that was a pretty convoluted post

    attempt2

    the page in questionhttp://www.philipdusel.com/gyp.html

    is using jquery link(js/jquery.scrollTo-min.js) and this bit of code
    // ScrollTo modification
    $(' .prev,.next, .advance-link,').live('click', function() {
    var href = $(this).attr('href');
    $('ul.thumbs').scrollTo($('.thumb[href=' + href + ']'), {axis: 'y'});
    });
    1)when you click on the next arrow it pulls the scroll bar down, except the selected image is scrolled past...not into view as it should.
    try clicking on the green border( "advance-link") you will see the behavior as it should be. Also the previous arrow functions as it should. perhaps this issue is stated more eloquently here http://forum.jquery.com/topic/anyone...n-modification

    2)ideally i would fix the Javascript to make this work. That so far has proved impossible for me SO i was going to try to wrap the ".next," arrow in a div with the "advance-link" class,

    3) i tried things like removing the ".next," from the script above and then..
    <div id="advance-link" class"advance-link"><div id="next" class="next"></div>
    but this(now it seems obviously) does not work


    Thank You

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •