|
-
Jun 28th, 2005, 04:50 PM
#1
Thread Starter
Hyperactive Member
DropDown Menu
Hello, I downloaded a dropdown menu from pscode.com. Everything works fine, except at 800x600 resolution the horizontal menu isn't aligned. You can change the LEFT value in config.js. I was wondering, how could I have it set a different value if the users resolution is 800x600?
Code:
If LostAngel.Tag = "Programming" then
LostAngel.Caption = "Awake"
Else
LostAngel.Caption = "Dreaming of Code"
End If
-
Jun 29th, 2005, 12:44 PM
#2
Re: DropDown Menu
Well...
Code:
<script type="text/javascript">
<!--
var ScreenResolution = screen.availHeight + "x" + screen.availWidth;
if (ScreenResolution = "800x600"){
// Do somehting here....
}
//-->
</script>
Cheers,
RyanJ
-
Jun 30th, 2005, 03:26 PM
#3
Thread Starter
Hyperactive Member
Re: DropDown Menu
Thanks, one more question. If I were to set a tables Alignment to something depending on the Resolution, how would I do so?
Code:
If LostAngel.Tag = "Programming" then
LostAngel.Caption = "Awake"
Else
LostAngel.Caption = "Dreaming of Code"
End If
-
Jun 30th, 2005, 04:25 PM
#4
Re: DropDown Menu
 Originally Posted by LostAngel
Thanks, one more question. If I were to set a tables Alignment to something depending on the Resolution, how would I do so?
Use the above code and then access the tables style attribute and then set its align attribute to the desired value 
Or if you were refering to the left or right values you can access them in the same way 
Cheers,
RyanJ
-
Jul 1st, 2005, 05:27 AM
#5
Re: DropDown Menu
Of course, the thing breaks if the user has a larger resolution and doesn't use his browser at full-screen. You might want to query the browser window size instead.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 1st, 2005, 08:33 AM
#6
Thread Starter
Hyperactive Member
Re: DropDown Menu
Thanks guys, hopefully this will be my last question for awhile. I notice that the page looks great in firefox...but in IE, the menu is missaligned. The following is the code I have for changing alignment based on resolution:
VB Code:
if (window.screen.width < 1024) {
LEFT=110;
}
if (window.screen.width > 1020) {
LEFT=250;
}
I know that navigator.appName returns your browser name, how can I have it detect if the browser is IE, if it's IE have it set the LEFT var based on resolution. And if it's Netscape, have it set LEFT var based on the resolution?
Code:
If LostAngel.Tag = "Programming" then
LostAngel.Caption = "Awake"
Else
LostAngel.Caption = "Dreaming of Code"
End If
-
Jul 2nd, 2005, 07:59 AM
#7
Re: DropDown Menu
This will detect IE....
Code:
var Browser = navigator.userAgent.toLowerCase();
if (Browser.search(/msie\s(\d+(\.?\d)*)/) != -1){
// Yes this is IE...
}
Cheers,
RyanJ
-
Jul 2nd, 2005, 08:08 AM
#8
Re: DropDown Menu
It might be Opera. It disguises as IE by default.
Object tests are more effective. I believe that this code truly identifies IE, and only IE:
Code:
if(typeof(window.ActiveXObject) == "function")
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 2nd, 2005, 08:16 AM
#9
Re: DropDown Menu
 Originally Posted by CornedBee
It might be Opera. It disguises as IE by default.
Object tests are more effective. I believe that this code truly identifies IE, and only IE:
Code:
if(typeof(window.ActiveXObject) == "function")
Indeed that does only work with IE as only IE used ActiveX technology 
I have never seen that one before - good job 
Cheers,
RyanJ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|