Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » Need help - HTML Website (Multiple Pop-ups)


Need help - HTML Website (Multiple Pop-ups)

Reply
  #1 (permalink)  
Old 07-24-08, 01:40 PM
jd77v17 jd77v17 is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Angry Need help - HTML Website (Multiple Pop-ups)

I need help - I'm very new to this stuff and I'm just trying my best to build a personal website for private use. I either need to have a single button my webpage that opens a pop-up which is on a 10 second delay, where after 10 seconds the pop-up changes to a different link, then another 10 seconds, different link and so on. Or I need to figure out on the following script how to make each website link open up in different pop-up windows.

I'm not going to be using goodle, msn, and yahoo those are just examples. Any help is greatly appreciated.


__________________________________________________ ______________
HTML Code:
<script> 
function openPopup(url) { 
    popup=window.open(url,'Test','width=100,height=100'); 
   setTimeout("closePopup()",10000); 
} 

function closePopup() { 
    if (!popup.closed) 
        popup.close();
} 

</script>
<a href="#" onMouseover="openPopup('http://www.google.com')">Open1</a>
<br>
<a href="#" onMouseOver="openPopup('http://www.msn.com')">Open2</a>
<br>
<a href="#" onMouseOver="openPopup('http://www.yahoo.com')">Open3</a>
<br>

Last edited by Nico; 07-25-08 at 02:51 AM.
Reply With Quote
  #2 (permalink)  
Old 07-25-08, 12:51 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Javascript issues should be posted in the javascript forum.

anyway, something like this?
javascript Code:
  1. <script type="text/javascript">
  2. var popup;
  3. var i = 0;
  4. var pages = ['http://www.google.com', 'http://www.msn.com', 'http://www.yahoo.com']
  5.  
  6. function openPopup() {
  7.   popup=window.open(pages[i],'Test','width=100,height=100 ');
  8.   setTimeout("navigateToNext()",10000);
  9. }
  10.  
  11. function navigateToNext() {
  12.   i++;
  13.   if (pages[i] == undefined) { closePopup(); }
  14.   popup.window.location = pages[i];
  15.   setTimeout("navigateToNext()",10000);
  16. }
  17.  
  18. function closePopup() {
  19.   if (!popup.closed)
  20.      popup.close();
  21. }
  22.  
  23. </script>
  24. <a href="javascript:openPopup();">Open</a>
Reply With Quote
  #3 (permalink)  
Old 07-25-08, 05:29 AM
jd77v17 jd77v17 is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Spin Thanks

This partially worked. I had to click on the button each time to cycle through the pages though. Any way they can cycle through the links every 10 seconds instead of me having to click it over and over? Also when it got to the last link and I hit the button again it gave me a path error.

This is great though -
Reply With Quote
  #4 (permalink)  
Old 07-25-08, 06:04 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Atleast on FF3 the script navigates the popup to the next url every 10 secs and closes the window 10 secs after the last page has been reached.
Reply With Quote
  #5 (permalink)  
Old 07-25-08, 06:07 AM
jd77v17 jd77v17 is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I would like to run this solo not embedded, what file extension should I give it?

I also don't know what FF3 is, sorry.
Reply With Quote
  #6 (permalink)  
Old 07-25-08, 06:13 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
FF3 = firefox version 3.

What do you mean with "solo not embedded"?

Also tested on IE7, seems that it throws a Permission denied error when trying to navigate the popup.

Works fine on Opera 9 and Safari 3
Reply With Quote
  #7 (permalink)  
Old 07-25-08, 07:55 AM
jd77v17 jd77v17 is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Thanks

Oh ok, I was trying IE6, I use Firefox anyways let me give that a try -thanks!

Solo as in i am not imbedding it into a page I'm using it by itsself for a project.

I will elt you know how it goes - Thanks!
Reply With Quote
  #8 (permalink)  
Old 07-25-08, 07:58 AM
jd77v17 jd77v17 is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Your A Genius! It works perfectly on FF. This is going to be a huge help to me - Thanks so much <?Wille?>
Reply With Quote
  #9 (permalink)  
Old 07-25-08, 08:11 AM
jd77v17 jd77v17 is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Let me ask one more think how can I make it loop and start from the first link again instead of closing out after the last link?
Reply With Quote
  #10 (permalink)  
Old 07-26-08, 05:11 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
javascript Code:
  1. function closePopup() {
  2.   i=0;
  3.   navigateToNext();
  4. }
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
html tutoral thefrtman HTML/XHTML/XML 5 04-27-09 10:25 AM
[SOLVED] Problem with php include html website tyrowen HTML/XHTML/XML 1 06-20-08 03:27 AM
100 ways to get more traffic jorokolarov The Lounge 12 12-06-07 07:20 PM
Need website design or HTML coding help? website_help HTML/XHTML/XML 0 05-26-05 12:07 PM
FS: Prozilla Memberships (Turnkey Sites) - $10-15 less than Retail! rockergrrl General Advertisements 0 08-11-04 12:05 AM


All times are GMT -5. The time now is 09:02 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.