Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 06-22-2010, 01:57 AM hover box
asmalik12's Avatar
Extreme Talker

Posts: 173
Name: Abdullah Saleem
Trades: 0
Hi,

I wanna to add a Javascript Box which appears on onmouseclick of the link.

Like in this page : Page, at the top of box u can see a [Sign in] Link. How could I add a box which appears down when someone click on the [Sign in]???
__________________
"Think 100 times before you take a decision, But once that decision is taken, stand by it as one man." - Quaid-e-Azam
asmalik12 is offline
Reply With Quote
View Public Profile Visit asmalik12's homepage!
 
 
Register now for full access!
Old 06-22-2010, 10:44 PM Re: hover box
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
You could have an absolutely placed DIV just below the Sign In link, then onclick, change the DIV's display to 'block' . Something like this:

<a href="#" onclick="javascript: document.getElementById('sIB').style.display='bloc k';">Sign In</a>
<p>More Content</p>
<div id="sIB" style="display:none;margin-top:-50px;position:absolute;background:#888888;padding: 20px;border:10px solid #666666;color:#ffffff;">Sign In Box Contents Here</div>
<p>Content Content Content</p><p>Hoooray for content</p>

Then just have

<body onclick="javascript: document.getElementById('sIB').style.display='none ';">



****Currently working on better solution, check back soon for update

EDIT: Done :P

///Working show/hide sign in box script
Code:
<a href="#" onclick="javascript: if(sIB.style.display=='none'){sIB.style.display='block';}else {sIB.style.display='none';}">Sign In</a>
<p>More Content</p>

<div id="sIB" style="display:none;margin-top:-50px;position:absolute;background:#888888;padding:20px;border:10px solid #666666;color:#ffffff;">Sign In Box Contents Here</div>
<p>Content Content Content</p><p>Hoooray for content</p>
Even works with floats, everything!
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!

Last edited by Physicsguy; 06-22-2010 at 10:53 PM..
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 06-23-2010, 01:12 AM Re: hover box
asmalik12's Avatar
Extreme Talker

Posts: 173
Name: Abdullah Saleem
Trades: 0
Following is the code where I want to write it :

PHP Code:
      $toplinks6 =  get_option('stylewp_toplinks6'); 
      
$toplinks4 get_option('stylewp_toplinks4'); 

      echo 
'<br /><a class="topbarlink" href="' get_settings('home') . '/wp-login.php">' $toplinks6 '</a>  &nbsp;|&nbsp; <a class="topbarlink" href="' get_settings('home') . '/wp-login.php?action=register">' $toplinks4 '</a>  '
__________________
"Think 100 times before you take a decision, But once that decision is taken, stand by it as one man." - Quaid-e-Azam
asmalik12 is offline
Reply With Quote
View Public Profile Visit asmalik12's homepage!
 
Old 06-23-2010, 02:19 AM Re: hover box
Novice Talker

Posts: 8
Trades: 0
no idea about that sorry
alibills is offline
Reply With Quote
View Public Profile
 
Old 06-23-2010, 03:20 AM Re: hover box
asmalik12's Avatar
Extreme Talker

Posts: 173
Name: Abdullah Saleem
Trades: 0
well, if I add '#' in href, but how to add Javacript in echo.
__________________
"Think 100 times before you take a decision, But once that decision is taken, stand by it as one man." - Quaid-e-Azam
asmalik12 is offline
Reply With Quote
View Public Profile Visit asmalik12's homepage!
 
Old 06-23-2010, 09:22 AM Re: hover box
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
To add a JavaScript in an echo...

Say your echo is this : echo "<script> ~~~~~</script>"; but that doesn't work. The quotes mess it up. But you setimes need them. Simple fix:

echo <<<Script
script stuff
Script;

Done!


Now to add what you want you can just do that technique above in my example
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!

Last edited by Physicsguy; 06-23-2010 at 09:24 AM..
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to hover box
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26421 seconds with 12 queries