Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript show/hide

  • This topic is empty.
Viewing 15 posts - 46 through 60 (of 89 total)
  • Author
    Posts
  • #241376
    Allie_P
    Participant

    Thanks. May I ask what the issue was?

    Next step would be to add the image slider. Would you recommend a specific set up? I mean, I think I can do it on my own, I just don’t wanna take a route that could potentially make it harder to implement the other features down the road.

    It doesn’t have to be anything fancy. A simple caption for each slide and prev/next buttons is fine. Just like what we talked initially.

    #241385
    Shikkediel
    Participant

    It was still referring to the buttons for ordered and random layout which aren’t present. This created errors, one could see them in the developer tools console. Plus you copied the script twice…

    If you create the basic HTML markup, I’ll write a bit of code for a slider effect. Could be a simple as you like. Don’t think you need a plugin for the JS then.

    #241391
    Allie_P
    Participant

    I could use this one, couldn’t I?

    #241403
    Shikkediel
    Participant

    There’s about a million options for a slider out there but I would personally not use any of them for just a previous and next button. All else only bloats your code and will slow down the website. It’ll also make make it hard for myself to help you out if anything’s not working right with it.

    The basic markup would only need parents (that are already there) with child elements that are all hidden but one. A minor amount of code is then needed to add the desired functionality you described.

    #241419
    Allie_P
    Participant

    Something like this?

    <div class="widget widget-20">
    
        <div id="widget-20-title" class="widget-title">AAPL Apple</div>
        <div id="widget-20-hide" class="widget-hide">close</div>
    
        <div class="sliderWrapper">
            <div id="image_slider">
                <div><img src="images/image1.jpg"></div>
                <div><img src="images/image2.jpg"></div>
                <div><img src="images/image3.jpg"></div>
                <div><img src="images/image4.jpg"></div>
            </div>
    
        <div id="caption"></div>
    
            <div class="controls">
                <span id="prev">PREV</span>
                <span id="next">NEXT</span>
            </div>
        </div>
    
    </div>
    

    Like you’ve said, there’s about a million options. I’m getting kinda lost… :(

    #241421
    Shikkediel
    Participant

    I wouldn’t look any further anyway. I can work with the above. Gimme a bit and I’ll have a go to add the next step.

    Edit – Update

    #241430
    Allie_P
    Participant

    Thanks, works great, except it’s missing the captions.
    PREV/NEXT should be both on the right side with the caption on the left.

    #241452
    Shikkediel
    Participant

    What are the captions for exactly then – aren’t they for the individual images?

    #241453
    Allie_P
    Participant

    They are. Each image should have its own caption.

    #241460
    Shikkediel
    Participant

    In that case it was misplaced anyway. Already took something like that into account by keeping the wrapper divs around the images. You could add individual captions or pseudo elements to these divs without that interfering with the script.

    :-)

    #241494
    Allie_P
    Participant

    OK, I think I get it. I’m gonna give it a try.
    Would it be possible to soften the transitions? I mean, having the images fade out/in just a little bit… Don’t do it, just let me know how easy (or not) that would be. ;)

    #241515
    Shikkediel
    Participant

    Fades should be easy enough. A cross fade’s a bit harder because of the positioning but shouldn’t be much of an issue either.

    #241520
    Allie_P
    Participant

    This behavior. You click NEXT and the current image fades out and (only then) the next one fades in. If it’s too complicated, just forget about it.

    #241540
    Shikkediel
    Participant

    Done, have a look at the pen I made earlier…

    #241548
    Allie_P
    Participant

    Thanks, it looks great.
    The next step is for me to add the captions and do some styling.

    By the way, it’s possible to choose some of the widgets to be open by default (on load) and others to be closed (docked), right? I forgot to mention it before, but that’s kinda crucial to the whole thing.

Viewing 15 posts - 46 through 60 (of 89 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.