d.roc
04-24-2010, 06:50 AM
1) Script Title: Chrome CSS Drop Down Menu (v2.5)
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm
Hi all,
I have downloaded and customised the above script for use on my site; current test page is here: http://shawitservices.com/index_menu.php
The "main" div (922px wide and encompassing everything other than the outer background stripes along the top and bottom) is set with auto left and right margins in order for the background stripes to fill the browser window left and right and the div to center itself inside. The drop down menus work well when the browser window is no wider than this "main" div.
However, when the browser window is wider than the "main" div (ie you can see the background stripes on either side) the drop down menus fall in the wrong place (to the right of the menu heading).
If the "auto" margin setting for the "main" div is removed from my layout.css file (ie set to a fixed value instead), the menus always fall in the right place, however I like my layout with background stripes the way it is. :)
I'm OK with HTML, CSS and a little PHP (if a little sloppy), but JavaScript is still totally foreign to me.
So, my question is, can I make the script in this case reference the edge of the div that it is in (or a particular div I specify) rather than the browser window's edge (which I assume it to be referencing now) so as to keep the drop down menus in the same position regardless of browser window sizing?
Thanks,
Mat
PS I have renamed the css and js files from their original names to dropdown.css and dropdown.js
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm
Hi all,
I have downloaded and customised the above script for use on my site; current test page is here: http://shawitservices.com/index_menu.php
The "main" div (922px wide and encompassing everything other than the outer background stripes along the top and bottom) is set with auto left and right margins in order for the background stripes to fill the browser window left and right and the div to center itself inside. The drop down menus work well when the browser window is no wider than this "main" div.
However, when the browser window is wider than the "main" div (ie you can see the background stripes on either side) the drop down menus fall in the wrong place (to the right of the menu heading).
If the "auto" margin setting for the "main" div is removed from my layout.css file (ie set to a fixed value instead), the menus always fall in the right place, however I like my layout with background stripes the way it is. :)
I'm OK with HTML, CSS and a little PHP (if a little sloppy), but JavaScript is still totally foreign to me.
So, my question is, can I make the script in this case reference the edge of the div that it is in (or a particular div I specify) rather than the browser window's edge (which I assume it to be referencing now) so as to keep the drop down menus in the same position regardless of browser window sizing?
Thanks,
Mat
PS I have renamed the css and js files from their original names to dropdown.css and dropdown.js