Forums

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

Home Forums JavaScript need to display an image from gallery to open in another div after click

  • This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #210070
    Ahmed-22
    Participant

    hello,

    just need any one to help me

    i have 20 div for images and videos
    when i click on any div display the image or video in amain div

    also need this main div to display the first image or video as a default

    sry, but iam beginner and need ur help :)

    Thanx.

    #210071
    Shikkediel
    Participant

    Show us some code please, preferably a Codepen demo…

    #210076
    Ahmed-22
    Participant

    thanx dear for your replay ..
    but sry, i searched throuh codepen for a code similar to my design but i didn’t find ..

    this is the design which i need to do ..

    http://files.fm/g/lwpjufh#aa/example.png

    thanx again :)

    #210078
    Shikkediel
    Participant

    Well, it shouldn’t be too difficult and I’d write up some code but I’d have to know what elements to base it on…

    $(function() {
    
        $('.element').click(function() {
    
            var path = this.src;
    
            if (path) $('#mainelement').attr('src', path);
        });
    });
    
    #210079
    Paulie_D
    Member

    Just do a search for “Thumbnail Gallery”…that should get you loads of options.

    #210080
    Ahmed-22
    Participant

    elements will be images or video

    #210082
    Shikkediel
    Participant

    No code no glory. Demo or it didn’t happen.

    #210083
    Paulie_D
    Member

    Ahhh…you’d dived to the heart of the matter..

    #210096
    Ahmed-22
    Participant

    believe me if i have code i will do what i want alone :D
    but my problem that i need code

    also i search for long time for a code suitable for my design but i didn’t find
    so,, iam here need ur help .. need some code :D

    #210102
    Shikkediel
    Participant

    i have 20 div for images and videos

    my design

    So where are they then? Not that I’m begging to see…

    #210103
    Paulie_D
    Member

    Feeding the vampire is never a wise idea.

    #210106
    Shikkediel
    Participant

    True enough, I’ll hang up the garlic instead.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.