Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-11-2013, 11:23 PM   PM User | #1
PatsFan89
New to the CF scene

 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
PatsFan89 is an unknown quantity at this point
Slide in from left

Hello,

I wanna make my links slide in from the left, as shown in the demo here:

http://www.templatemonster.com/demo/38913.html

I'd like them to slide in from the left in a semi-transparent frame exactly as shown in the demo. Any help is greatly appreciated. Thanks.
PatsFan89 is offline   Reply With Quote
Old 01-12-2013, 09:32 AM   PM User | #2
sbhmf
New Coder

 
Join Date: Jan 2013
Location: Sunnyvale, CA
Posts: 40
Thanks: 3
Thanked 1 Time in 1 Post
sbhmf is an unknown quantity at this point
Looks like you want a pull-down menu.

Another example of such a menu is here: http://www.javascriptworld.com/js4e/.../script01.html

...and its script may be found here: http://www.javascriptworld.com/js4e/...ript13.01.html

The site's author has more great stuff here: http://www.javascriptworld.com/js4e/scripts/index.html

I recommend his book as a great JavaScript primer.

Well, that should get you started...
sbhmf is offline   Reply With Quote
Old 01-12-2013, 11:25 AM   PM User | #3
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
Quote:
Originally Posted by sbhmf View Post
Looks like you want a pull-down menu.

Another example of such a menu is here: http://www.javascriptworld.com/js4e/.../script01.html

...and its script may be found here: http://www.javascriptworld.com/js4e/...ript13.01.html

The site's author has more great stuff here: http://www.javascriptworld.com/js4e/scripts/index.html

I recommend his book as a great JavaScript primer.

Well, that should get you started...
That site is about 10 years out of date - I wouldn't use it. It refers to the 4th edition of the book, but there is now an eight edition.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS

Last edited by AndrewGSW; 01-12-2013 at 11:31 AM..
AndrewGSW is offline   Reply With Quote
Old 01-12-2013, 04:40 PM   PM User | #4
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,358
Thanks: 3
Thanked 458 Times in 445 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
http://www.vicsjavascripts.org.uk/Dr.../DropInBox.htm
__________________
Vic

God Loves You and will never love you less.

http://www.vicsjavascripts.org.uk/

If my post has been useful please donate to http://www.operationsmile.org.uk/
vwphillips is offline   Reply With Quote
Old 01-12-2013, 05:52 PM   PM User | #5
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
@vwphillips
Could you briefly describe the following code please? I assume it's using the time-interval in order to smooth out the animation.

Code:
animate:function(o,f,t,srt,mS,ud){
  clearTimeout(o.dly);
  var oop=this,ms=new Date().getTime()-srt,now=(t-f)/mS*ms+f;
  if (isFinite(now)){
   o.now=Math.max(now,f<0||t<0?now:0);
   o.obj.style[o.mde]=o.now+'px';
  }
  if (ms<mS){
   o.dly=setTimeout(function(){ oop.animate(o,f,t,srt,mS,ud); },10);
  }
  else {
   o.now=t;
   o.obj.style[o.mde]=t+'px';
   if (ud){
    o.obj.style.visibility=o.msk.style.visibility='hidden';
   }
  }
 },
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
AndrewGSW is offline   Reply With Quote
Old 01-12-2013, 07:33 PM   PM User | #6
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,358
Thanks: 3
Thanked 458 Times in 445 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
Code:
// parameter 0 = an object
// parameter 1 = start value
// parameter 2 = finsh value
// parameter 3 = a Date Object
// parameter 4 = the animate duration in milli seconds
// parameter 5 = a flag

animate:function(o,f,t,srt,mS,ud){
  clearTimeout(o.dly);
             //new Date()- the srt Date = ms = the time the function has been cycling
  var oop=this,ms=new Date().getTime()-srt,now=(t-f)/mS*ms+f;  // now = (start value - finish value)/the animate duration * new Date object + the finish value
  if (isFinite(now)){          // if now is a good number
   o.now=Math.max(now,f<0||t<0?now:0);  // make sure that now cannot be < 0 foe with and height etc ie can only be <0 if either the start value or finish value is less than 0
   o.obj.style[o.mde]=o.now+'px';       // if o.mode was 'width'  o.obj.style.width=o.now+'px';
  }
  if (ms<mS){         // cycle until the ms is geater than mS
   o.dly=setTimeout(function(){ oop.animate(o,f,t,srt,mS,ud); },10);
  }
  else {
   o.now=t;  // the object now is set to the finish value as now may not be tottally accuate
   o.obj.style[o.mde]=t+'px'; // object.obj style is now accurate
   if (ud){    // if the flag is true do whatever
    o.obj.style.visibility=o.msk.style.visibility='hidden';
   }
  }
 },
__________________
Vic

God Loves You and will never love you less.

http://www.vicsjavascripts.org.uk/

If my post has been useful please donate to http://www.operationsmile.org.uk/

Last edited by vwphillips; 01-12-2013 at 07:36 PM..
vwphillips is offline   Reply With Quote
Old 01-12-2013, 07:42 PM   PM User | #7
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
@Vic Thank you. Andy.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
AndrewGSW is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:14 AM.


Advertisement
Log in to turn off these ads.