Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1131 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

drop-down-list, id's and navigation

Thread title: drop-down-list, id's and navigation
Closed Thread    
    Thread tools Search this thread Display Modes  
02-17-2009, 01:45 PM
#1
G-Sun is offline G-Sun
Status: Member
Join date: Feb 2008
Location: Norway
Expertise:
Software:
 
Posts: 101
iTrader: 0 / 0%
 

G-Sun is on a distinguished road

  Old  drop-down-list, id's and navigation

Hi!

I've made an event-list, by months. And I've put a drop-down-navigation on the top of it. Page here.

It navigates with ID's and a little javascript.
However it doesn't work in ie7 (works nice in Firefox and Safari).
Are there any ie-solutions other than making the page reload on selected navigation-item (adding a baseurl)?

Javascript:
Code:
<script type="text/javascript" language="javascript">
<!--
function menu_goto( menuform )
{

    selecteditem = menuform.newurl.selectedIndex ;
    newurl = menuform.newurl.options[ selecteditem ].value ;
    if (newurl.length != 0) {
      location.href = newurl ;
	  scroll(0,0) ;
    }
}
//-->
</script>
html:
Code:
<form action="" name="newurl" id="newurl">
			          <label>Gå til: </label>
					<select onchange="menu_goto(this.form)" name="newurl">
			            <option value="#2009Januar">2009 Januar</option>
			            <option selected="selected" value="#2009Februar">2009 Februar</option>
			            <option value="#2009Mars">2009 Mars</option>
			            <option value="#2009April">2009 April</option>
			            <option value="#2009Mai">2009 Mai</option>
			            <option value="#2009Juni">2009 Juni</option>
			            <option value="#2009Juli">2009 Juli</option>
			            <option value="#2009August">2009 August</option>
			            <option value="#2009September">2009 </option>
...

02-18-2009, 12:18 PM
#2
G-Sun is offline G-Sun
Status: Member
Join date: Feb 2008
Location: Norway
Expertise:
Software:
 
Posts: 101
iTrader: 0 / 0%
 

G-Sun is on a distinguished road

  Old

I get an error-message here in IE:
Code:
<script language="javascript" type="text/javascript">
<!--
function menu_goto( menuform )
{
    // see http://www.thesitewizard.com/archive/navigation.shtml

    selecteditem = menuform.newurl.selectedIndex ;
    newurl = menuform.newurl.options[ selecteditem ].value ;
    if (newurl.length != 0) {
//      window.
	  location.href = newurl ;
	  scroll(0,0) ;
//	  window.event.returnValue=false;
    }
}
//-->
</script>
Says: "Object doesn't support this property or method"

02-18-2009, 03:32 PM
#3
G-Sun is offline G-Sun
Status: Member
Join date: Feb 2008
Location: Norway
Expertise:
Software:
 
Posts: 101
iTrader: 0 / 0%
 

G-Sun is on a distinguished road

  Old  Solved

Closed Thread    


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

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed