Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    up N ya
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Drop Down Menu Multiple Targets. Yet Another Challenge 4 U

    I'm a the webmaster over at siccness.net a site I designed a couple months back. The design called for use of a drop down menu which was no sweat.. First problem I ran into was how to make the links in the drop down menu target in the I frame (Sumthing you guys solved for me)....

    Now I've ran into yet another problem. Making multiple targets with one drop down menu. I want to have some links target a new window and I want some to target the I Frame and thats where you script masters come in.. CAN WE DO IT....

    The Link to the site is: http://siccness.net

    You'll see what I'm talking about once you see my navigation box...

    Thanks yall..
    B-pLeAsE
    HELP ME!

  • #2
    New Coder
    Join Date
    Aug 2002
    Location
    up N ya
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Anyone feel like taking this one on?
    HELP ME!

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    perhaps something like this?
    Code:
    function doLink(opt) {
    	var targ = parseInt(opt.target);
    	var link = opt.value;
    	switch (targ) {
    		case 0 : Do whatever with 'link' here; break;
    		case 1 : Do whatever with 'link' here; break;
    		case 2 : Do whatever with 'link' here; break;
    		case 3 : Do whatever with 'link' here; break;
    		}
    	}
    
    (...HTML...)
    	
    <select onChange="doLink(this.options[this.selectedIndex])">
    <option value="page1.htm" target="1">link</option>
    <option value="page2.htm" target="0">link</option>
    <option value="page3.htm" target="1">link</option>
    <option value="page4.htm" target="3">link</option>
    <option value="page5.htm" target="2">link</option>
    </select>

  • #4
    New Coder
    Join Date
    Aug 2002
    Location
    up N ya
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'll give it a shot.. thanks for helping out...
    HELP ME!

  • #5
    New Coder
    Join Date
    Aug 2002
    Location
    up N ya
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can't get it to work, I set up a Demo page maybe i'm doing sumthing wrong....

    http://wckillaz.net/navigate.html

    Thanks again...
    HELP ME!

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's becuase you aren't doing anything in the case statement. Here, more like this...
    Code:
    function doLink(opt) {
    	var targ = parseInt(opt.target);
    	var link = opt.value;
    	switch (targ) {
    		case 0 : window.open(link,'_blank',''); break;
    		case 1 : top.frames['I1'].location.href=link; break;
    		}
    	}

  • #7
    New Coder
    Join Date
    Aug 2002
    Location
    up N ya
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It Worked!!!!

    Much Thanks Man! You dont know how much this helps me out. if i wanted to make target 3 a pop up window could i make that happen or would that be too complex?
    HELP ME!

  • #8
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can make as many cases as you like...
    Code:
    function doLink(opt) {
    	var targ = parseInt(opt.target);
    	var link = opt.value;
    	switch (targ) {
    		case 0 : window.open(link,'_blank',''); break;
    		case 1 : top.frames['I1'].location.href=link; break;
    		case 2 : //code ; break;
    		case 3 : //code ; break;
    		}
    	}

  • #9
    New Coder
    Join Date
    Aug 2002
    Location
    up N ya
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This navigation is nice, but i was wonderin if anyone can confirm it works in netscape.. I've had a few people complain about it not working.. -->> http://wckillaz.net
    HELP ME!

  • #10
    New Coder
    Join Date
    Aug 2002
    Location
    up N ya
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    bump...
    HELP ME!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •