Forums

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

Home Forums JavaScript JQuery Set Anchor As Body Image

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #175510
    mdrd88
    Participant

    Hello Everyone,
    I am trying to make a portfolio page where there is a ul and when you click on the link it will apply the anchor image to the body. I’ve tried searching but to no avail. Ideally I would like the jquery to say “get anchor src and apply that source to body” but I am too much of a newb to know how to do that.

    http://codepen.io/mdrd88/pen/zJpIG

    Thank you,
    Much appreciated

    #176048
    TheDutchCoder
    Participant

    Here you go!

    It’s not perfect (I’d personally would do some sort of pre-loading of the image) and you might want different styles, but it should do what you’re looking for!

    http://codepen.io/TheDutchCoder/pen/speoK

    #176091
    mdrd88
    Participant

    That is perfect! Thank you!

    #176094
    TheDutchCoder
    Participant

    Welcome!

    #176105
    mdrd88
    Participant

    Okay, so I am still ignorant. But how can I get figure out how to get a fade effect/preload of the image?

    Here is what I tried

    http://codepen.io/mdrd88/pen/BhujE

    #176122
    TheDutchCoder
    Participant

    That’ll work!

    I’m usually in favour of actually preloading images with AJAX, but this should be fine for a less-advanced approach ;-)

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