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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting Width To % ??????

    Hi i have no experience in javascript but i am using a javascript menu in my website and was wondering whether it is possible to set the width of my javascript menu as a percentage such as 100%???

    Code i have is below:

    Thanks

    Code:
    var MENU_POS = [
    {
    	//NAVIGATION BAR SETTINGS
    	// item sizes
    	'height': 15,     //height of naviagtion bar
    	'width': 138,    // Length of navigation bar
    	// menu block offset from the origin:
    	//	for root level origin is upper left corner of the page
    	//	for other levels origin is upper left corner of parent item
    	'block_top':60,     //position from top of page
    	'block_left': 0,    //position from left of page
    	// offsets between items of the same level
    	'top': 0,
    	'left': 140,
    	// time in milliseconds before menu is hidden after cursor has gone out
    	// of any items
    	'hide_delay': 600,
    	'expd_delay': 100,
    	'css' : {
    		'outer': ['m0l0oout', 'm0l0oover'],
    		'inner': ['m0l0iout', 'm0l0iover']
    	}
    },
    {
         //DROP DOWN LIST SETTINGS
    	'height': 16,
    	'width': 250,
    	'block_top': 17,
    	'block_left': 0,
    	'top': 17,
    	'left': 0,
    	'css': {
    		'outer' : ['m0l1oout', 'm0l1oover'],
    		'inner' : ['m0l1iout', 'm0l1iover']
    	}
    },
    {
    	'block_top': 4,
    	'block_left': 240,
    	'css': {
    		'outer': ['m0l2oout', 'm0l2oover'],
    		'inner': ['m0l1iout', 'm0l2iover']
    	}
    }
    ]

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    try changing 'width': 138, to

    'width': "100%",
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Providing that the script will allow for that ... it depends on the rest of the script.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #4
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try moving that setting into the stylesheet...

    'css' : {
    'outer': ['m0l0oout', 'm0l0oover'],
    'inner': ['m0l0iout', 'm0l0iover'],
    'width': '100%'
    }

    --
    HTH,
    Max


  •  

    Posting Permissions

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