Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
$30 to the person that solves this for me
Old 02-25-2008, 11:29 AM $30 to the person that solves this for me
Novice Talker

Posts: 7
Trades: 0
Hi all, im fed up of trying to sort out my drop down navigation menu myself therefore i am willing to give $30 to the person that sorts out the two problems i have with it.

My website is < removed > , dont worry theres no adult images on there, its just the page template. Iv only designed it in firefox so some items may appear out of place in IE.

Firstly, i need my menu so that when a user opens it, it remains open on all pages on the site until either the user closes it or leaves the site. I beleive you have to use cookies to acomplish this.

Secondly, if you go to my site and expand the menu, pay close attention to what happens. Sometimes the text on the menu will expand slightly faster than the background, so for a split second you have the black text of the menu over the advertisement box. Also sometimes the menu expands faster than the 'categories_background.png' changes to 'categories_background_active.PNG'. I require the whole menu to expand in sync, and the button images change at the same time so it looks smooth and professional.


You are free to edit my code to acomplish this. If you have any questions please ask.

Many thanks.

Last edited by chrishirst; 02-25-2008 at 12:06 PM..
leemp5 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-25-2008, 12:16 PM Re: $30 to the person that solves this for me
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Removed the URL as at some point in time it WILL. PM the OP for the URL

Quote:
Secondly, if you go to my site and expand the menu, pay close attention to what happens. Sometimes the text on the menu will expand slightly faster than the background, so for a split second you have the black text of the menu over the advertisement box. Also sometimes the menu expands faster than the 'categories_background.png' changes to 'categories_background_active.PNG'. I require the whole menu to expand in sync, and the button images change at the same time so it looks smooth and professional.
Quite normal behaviour for this to happen when switching background images in CSS, swapping classnames is quicker and much less prone to this problem.


Quote:
Firstly, i need my menu so that when a user opens it, it remains open on all pages on the site until either the user closes it or leaves the site. I beleive you have to use cookies to acomplish this.
Session variables (temporary cookies) are what you would be better using and for that we need to know the server side code you will be using.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-25-2008, 12:46 PM Re: $30 to the person that solves this for me
Novice Talker

Posts: 7
Trades: 0
What do you mean by swapping class names? I beleive im using a php script if thats what you mean by server side code?

Many thanks
leemp5 is offline
Reply With Quote
View Public Profile
 
Old 02-25-2008, 01:22 PM Re: $30 to the person that solves this for me
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
What do you mean by swapping class names?
instead of using

a:hover {
background-image:url(path);
}

which is relatively slow and clunky. You use DHTML

Code:
onmouseover="document.getElementById(this.id).className = 'name_of_CSS_class_to_apply';"

and switch it back using onmouseout

It is several times quicker and more responsive (especially in IE) than using the :hover pseudoclass.

Yep, PHP is what I mean by server side code.

And what you do is to initialise and set a session variable to true when the menu is clicked open. (AJAX call to server) then at the top of every page check for the session value and set the menu state to open if it is true.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-25-2008, 01:34 PM Re: $30 to the person that solves this for me
Novice Talker

Posts: 7
Trades: 0
Im currently using javascript to swap the two images when the menu is clicked open.

Also in the javascript below you can see that when the image is clicked the 'show' command comes into action to open the menu, then when it is clicked again the 'hide' command comes into action and closes the menu.

How would i add a "set a session variable to true" to this code and then check it at the top of every page?

<script language="JavaScript" type="text/JavaScript">
<!--
menu_status = new Array();

function showHide(theid){
if (document.getElementById) {
var switch_id = document.getElementById(theid);

if(menu_status[theid] != 'show') {
switch_id.className = 'show';
menu_status[theid] = 'show';
var image = document.getElementById('catclosed');
image.src = 'design_images/categories_background_active.PNG';
}else{
switch_id.className = 'hide';
menu_status[theid] = 'hide';
var image = document.getElementById('catclosed');
image.src = 'design_images/categories_background.PNG';
}
}
}

Many thanks
leemp5 is offline
Reply With Quote
View Public Profile
 
Old 02-25-2008, 01:38 PM Re: $30 to the person that solves this for me
Novice Talker

Posts: 7
Trades: 0
Oh sorry i didnt realise the website addy had been fromoved from my original post.

< removed from this one as well > theres no adult content on there is just a template.

Last edited by chrishirst; 02-25-2008 at 01:40 PM..
leemp5 is offline
Reply With Quote
View Public Profile
 
Old 02-25-2008, 02:00 PM Re: $30 to the person that solves this for me
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The point of having no "adult" content on currently is a moot one.
There will be some there at sometime in the future.

We have a lot of members now (and will have in the future) who are under the legal age for viewing adult material and the forum policy is NO adult URIs . clickable or NOT.


You have everything you need already set up in;
Code:
switch_id.className = 'show';
in the "show" and "hide" classes set the background image to the relevant image you want to use and get rid of the image swapping code.

When you dynamically load an image src with javascript the image has to be rendered and loaded into memory. Which is why you see a delay as it is being cached. Pre-caching the images won't help much either. The same issue occurs with images declared in a :hover pseudo class, they aren't rendered until needed and get unloaded when the hover goes off.
But when background images are specified in CSS the image is already being loaded in the browser memory space as the page is being rendered.

Unless someone beats me to it, I'll see what I can code up for a AJAX/PHP session setting script a bit later on.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-25-2008, 02:46 PM Re: $30 to the person that solves this for me
Novice Talker

Posts: 7
Trades: 0
Quote:
Originally Posted by chrishirst View Post

the forum policy is NO adult URIs . clickable or NOT.
Sorry i didnt realise, i was going to say is there a way i can delete it but its already been done .

Do you mean place the images in the .show class in the css? As i already have the background that appeard behind the links showin in the css.

If you cold come up with something for the cookies that would be great. Many thanks.
leemp5 is offline
Reply With Quote
View Public Profile
 
Old 02-25-2008, 03:03 PM Re: $30 to the person that solves this for me
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Do you mean place the images in the .show class in the css?
or in a class linked to the menu
Code:
.show #menuhead {
      background-image:url(showimage);
}

.hide #menuhead {
      background-image:url(hiddenimage);
}
have a container at the top of the menu with an ID of "menuhead" and it will follow the classname you give to the menu container
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-25-2008, 05:16 PM Re: $30 to the person that solves this for me
Novice Talker

Posts: 7
Trades: 0
Thanks for that il give it a try. Any ideas on the sessions cookies? Thanks
leemp5 is offline
Reply With Quote
View Public Profile
 
Old 02-25-2008, 07:02 PM Re: $30 to the person that solves this for me
Novice Talker

Posts: 7
Trades: 0
I cant seem to get the .class #contains thingy to work. Below it the html im using for the menu:

<a class="menu1" onclick="showHide('menu')"><img id="catclosed" src="design_images/categories_background.PNG"/></a>
<div id="menu" class="hide">
<ul class="nobullet">
<li><span class="title" >A</span></li>
<li><a href="#" class="submenu" >category1</a></li>
<li><a href="#" class="submenu">category2</a></li>
<li><a href="#" class="submenu">category3</a></li>
<li><a href="#" class="submenu">category4</a></li>
<li><a href="#" class="submenu">category5</a></li>
<li class="top"><span class="title" >B</span></li>
<li><a href="#" class="submenu">category6</a></li>
<li><a href="#" class="submenu">category7</a></li>
<li><a href="#" class="submenu">category8</a></li>
<li><a href="#" class="submenu">category9</a></li>
<li><a href="#" class="submenu">category10</a></li>
</ul>
</div><!--menu end-->

IV tried allsorts, chanching the class="menu1" to id="menu1" and putting the image into the css as a background image.
Iv tried putting the <a></a> into a <div> container.
Iv tried placing a <div> container inside the <a> tags.
I keep getting different results but it seems the .show #container dosent work.
leemp5 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to $30 to the person that solves this for me
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 3.20875 seconds with 12 queries