Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Previous/Next

  1. #1
    New Coder
    Join Date
    Jul 2010
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Previous/Next

    Hi there. I am sort of a mid-level javascripter, and I'm wondering if anyone would know a code I could use to make these previous/next buttons active. The reason I can't figure it out is that the thumbnails below currently control which image appears above, and I'd like the previous/next to also do so, but in the relative order of the corresponding thumbnails. I'd image there would be some way or specifying the current image, and adding either +1 or -1 or something along those lines? any help would be greatly appreciated. Page link below.

    http://www.annaleithauser.com/rosema...e/country.html

  • #2
    Regular Coder
    Join Date
    Jul 2006
    Posts
    399
    Thanks
    33
    Thanked 7 Times in 7 Posts
    Why dont you use a jQuery prev/next fadeIn/fadeOut gallery, it will do the job much better and easier. Ex: http://www.1stwebdesigner.com/design...lay-solutions/

  • #3
    New Coder
    Join Date
    Jul 2010
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts
    thanks for the response...I've never used that and my only hesitation is that I have so much else going on in my gallery already...the thumbnails slide in and out, and I have all the images swapping correctly. Is there any type of script that would just either add or subtract 1 to the name of the currently displayed image?

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    I think we could do that, but you have a bigger error that you should fix, first.

    If I click on the >> arrow at the right of the thumbnails and then click on any thumbnail, I get a SPRY error message. Should you figure that bug out, first?

    But in the meantime, another problem you have is that ancient ancient DreamWeaver code in there. That stuff is so old, it creaks. Was used when computers still were larger than trucks. (Oh, okay....slight exaggeration.)

    Pretty much you should get rid of anything that starts with "MM_".

    And your code is FIGHTING itself!!!

    You have this:
    Code:
    <a onclick="MM_affectAppearFade( ... ) ...>
        <img ... onclick="MM_swapImage( ... ) ...>
    </a>
    ONE of those onclicks needs to go! But better would be to scrap *all* MM_ stuff.

    Ahh...I figured out why you get the SPRY error I noted!!!

    Your large image is
    Code:
    <img id="country_1" ...>
    Yet in one of the two sliding panels, all the onclick's refer to
    Code:
    <a onclick="MM_affectAppearFade('city_1', ... ) ...>
        <img ... onclick="MM_swapImage('city_1', ... ) ...>
    </a>
    and of course there is no such ID as "city_1", so *KABLOOEY*.

    Anyway, fix the basic problems first, then let's talk about next/previous.

    And if AT ALL possible, stop using DreadWalker. DuckWaster would have been better named "Nigthmare Weaver".
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    New Coder
    Join Date
    Jul 2010
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Great...thank you for all that. I see that the onclicks were clashing...so does the code I have for the 1st thumbnail look better? It seems to be creating the same problem when I put it online (it, along with all the other ones, works perfectly locally on my computer).

    Here's the code for that 1st thumbnail:

    <a href="#" onclick="MM_effectAppearFade('country_1', 2000, 0, 100, false); MM_swapImage('country_1','','images/country_1.jpg',1); changeCaption('1/12')"><img src="images/country_t1.jpg" name="country_t1" class="ibdr" width="45" height="45" id="country_t1" style="margin-right:1px"></a>



    Thanks!

  • #6
    New Coder
    Join Date
    Jul 2010
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Great...thank you for all that. I see that the onclicks were clashing...so does the code I have for the 1st thumbnail look better? It seems to be creating the same problem when I put it online (it, along with all the other ones, works perfectly locally on my computer).

    Here's the code for that 1st thumbnail:

    <a href="#" onclick="MM_effectAppearFade('country_1', 2000, 0, 100, false); MM_swapImage('country_1','','images/country_1.jpg',1); changeCaption('1/12')"><img src="images/country_t1.jpg" name="country_t1" class="ibdr" width="45" height="45" id="country_t1" style="margin-right:1px"></a>



    Thanks!

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    As I said, the problem with the slow images is because you are not pre-loading the large images.

    DreamWeaver does have a standard function for doing this. Or you could find one online. Or if you can't find one, I guess I could try creating one. But if I did that, I'd want to rewrite it all. <grin/>

    In the long run--and not very long--you'd be much better off just getting rid of *ALL* the DW code (anything that starts with MM_) and going entirely to some other library. Spry, if it will do it all. Something else, if not.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    bigblondehead (11-19-2010)

  • #8
    New Coder
    Join Date
    Jul 2010
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I guess I'm more of a novice than I thought...so anyhow it seems I've got the image problem solved...the thing I really need now is to focus on the Previous/Next buttons. Any thoughts on those? I really don't know how to start. Thanks!

  • #9
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Quote Originally Posted by Old Pedant View Post
    And if AT ALL possible, stop using DreadWalker. DuckWaster would have been better named "Nightmare Weaver".
    Old Pedant, you know very well that it's name is ScreamWeaver.

    bigblondehead - I do suggest you follow this advice.

  • Users who have thanked Philip M for this post:

    bigblondehead (11-19-2010)

  • #10
    New Coder
    Join Date
    Jul 2010
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thank you all for your advice, but the thing I'm most concerned with now is the previous/next button. I like the way the page is currently functioning, and I'd just like to add functionality to those two. Thanks a lot!

  • #11
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    Okay...do you want them to move from set to set? That is, when you go NEXT from #12, does it move to #1 in the other set of 12??? Or should it cycle back to #1 in the current set? (The latter will be easier, because if you change sets you have to also change which sub-panel is showing.) Or do you want it to not cycle? (But then you have to provide a visual indication that the end has been reached, so cycling is easier.)
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #12
    New Coder
    Join Date
    Jul 2010
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I want it to actually go to the next image in the same set (or if it was image 12 in the 1st set, then image 1 from the next set--which I guess would have to load the 2nd set of lower images as well.) So If you're looking at picture 4, I'd like "next" to display picture 5, or "previous" to display picture 3. Ok let me know if that isn't clear, I'm struggling over here!

  • #13
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    *SIGH* Even after I tell you that going to the next set is harder?

    Okay, if I get time I'll muck with it.

    It's some really really messy code, so it's not as trivial as it should be.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #14
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,965
    Thanks
    79
    Thanked 4,429 Times in 4,394 Posts
    I'm going to push back one last time.

    Did you see this demo?
    http://coffeescripter.com/code/ad-gallery/

    That is *SO* close to what you have *AND* it has several additional nice features.
    Including the ability to put captions on the images, if you want. Including a timed slide show if you want. *AND* it even has the preload built in, so you won't see the problem you have now with new images.

    It would take a lot of work to take that thing you have now up to this level.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #15
    New Coder
    Join Date
    Jul 2010
    Posts
    26
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks, that is very nice, but the client definitely wants a previous/next button. Is there no simple way?


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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