1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Anyone know how to produce this sliding effect?

Discussion in 'HTML & Website Design' started by johnnywebb, Oct 7, 2012.

  1. #1
    Does anyone know how to produce the sliding effect found at the following website?

    http://www.beyonce.com/

    When you go to it, it slides outwards to the right. .. I guess so to indicate that it could be slide.

    When you click on the arrow it slides inward to the left, so it hides.

    What's also cool about it is the arrow changes direction to the right when it hides to the left.

    OR,

    maybe something like the sliding pop up window you first see when entering digitalpoint.com
     
    Last edited: Oct 7, 2012
    johnnywebb, Oct 7, 2012 IP
  2. scottlpool2003

    scottlpool2003 Well-Known Member

    Messages:
    1,708
    Likes Received:
    49
    Best Answers:
    9
    Trophy Points:
    150
    #2
    scottlpool2003, Oct 8, 2012 IP
  3. ntmedia

    ntmedia Active Member

    Messages:
    118
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    90
    #3
    CSS animation I think. I would do it with CSS3 animation. It's not available in IE yet though. I could do that.
     
    ntmedia, Oct 8, 2012 IP
  4. johnnywebb

    johnnywebb Greenhorn

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    18
    #4

    That is pretty cool. Just curious if there is way to make it so that the panel shows on it's own, without the need to hover over it. Then it can hide when clicked on.
     
    johnnywebb, Oct 8, 2012 IP
  5. ntmedia

    ntmedia Active Member

    Messages:
    118
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    90
    #5
    Yea it can be done with animating CSS keyframes. To be hidden on load, with delayed animation of, for example 1s, and after 1s to do the animation with duration of XX sec.
     
    ntmedia, Oct 8, 2012 IP
  6. xuled

    xuled Banned

    Messages:
    286
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you have knowledge about css then you can do it easily on your own. You can not make that easily.
     
    xuled, Oct 8, 2012 IP
  7. johnnywebb

    johnnywebb Greenhorn

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    18
    #7
    Great thanks... I'm somewhat familiar with CSS keyframes, just don't know how to keep the last frame to stay at 500px width .. here's my sample code:

    div
    {
    width:10px;
    height:500px;
    background:red;
    animation-name: myfirst;
    animation-duration: 5s;
    animation-timing-function: linear;
    animation-delay: 2s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-play-state: running;
    }


    @keyframes myfirst
    {
    from {background:red;}
    to {background:yellow;
    width:500px;
    }

    I would like to keep the width at 500px once the animation is over but it goes back to 10px. Can anyone help?
     
    johnnywebb, Oct 16, 2012 IP
  8. scottlpool2003

    scottlpool2003 Well-Known Member

    Messages:
    1,708
    Likes Received:
    49
    Best Answers:
    9
    Trophy Points:
    150
    #8
    Can you put it in a container?

    #framecontainer {
    width:500px;
    }

    I'm not overly familiar with keyframes, but it sounds like once the keyframe is finished it's resolving to a div limit of 10px so if it's in it's own div of 500px it may resolve back to that?
     
    scottlpool2003, Oct 17, 2012 IP
  9. irishmick

    irishmick Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Wow nice effect, love that website.
     
    irishmick, Oct 17, 2012 IP
  10. wizardofx

    wizardofx Well-Known Member

    Messages:
    572
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    140
    #10
    Here is a clue, looking at the code one of the lines is


    <!--[if lt IE 8]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->

    wiz
     
    wizardofx, Oct 17, 2012 IP
  11. wizardofx

    wizardofx Well-Known Member

    Messages:
    572
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    140
    #11
    wizardofx, Oct 17, 2012 IP
  12. scottlpool2003

    scottlpool2003 Well-Known Member

    Messages:
    1,708
    Likes Received:
    49
    Best Answers:
    9
    Trophy Points:
    150
    #12
    Or just stay away from iFrames, they're not good for mobile devices anyway which could impact your traffic severely. Am I correct in thinking the best way to do it would be to use objects rather than iFrames?
     
    scottlpool2003, Oct 17, 2012 IP
  13. johnnywebb

    johnnywebb Greenhorn

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    18
    #13

    Ha, thanks! That was a quick fix.. in order for it to remain at 500px width the width shoul be set to 500px from the div class. The only thing that needed to change was the width property in the first keyframe. Example...

    div
    {
    width:500px;
    height:500px;
    background:red;
    animation-name: myfirst;
    animation-duration: 5s;
    animation-timing-function: linear;
    animation-delay: 2s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-play-state: running;
    }


    @keyframes myfirst
    {
    from {background:red; width:10px; }
    to {background:yellow;
    width:500px;
    }

    That kept the expanding animation still at 500px width. Now if I could only close it on click. Anyone know how to do that?
     
    johnnywebb, Oct 17, 2012 IP
  14. scottlpool2003

    scottlpool2003 Well-Known Member

    Messages:
    1,708
    Likes Received:
    49
    Best Answers:
    9
    Trophy Points:
    150
    #14
    scottlpool2003, Oct 18, 2012 IP
  15. g r hasib

    g r hasib Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    I think your need to hide option.
    It is possible to JavaScript.
     
    g r hasib, Nov 6, 2012 IP