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.

CSS Forum


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



Reply
Change div content when hovering over li
Old 08-11-2009, 01:40 PM Change div content when hovering over li
Average Talker

Posts: 29
Name: Luke
Trades: 0
Hi,

I am working on this site: www.midbrook.com Right in the middle of the page there are 5 pictures (which are list items each with a unique class which controls what picture shows up). Just below I want to put a space (div) for dynamically changing text based on which item is being hovered over. (see attached picture) Can I do this with CSS alone? Whether yes or no, what method do you recommend? All advice welcome and appreciated!

Thanks!
Attached Images
File Type: jpg example.JPG (41.2 KB, 3 views)
__________________
Luke Robinson

Please login or register to view this content. Registration is FREE
lrobinson is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-11-2009, 03:45 PM Re: Change div content when hovering over li
angele803's Avatar
Perfectly Imperfect

Posts: 1,774
Name: Stephanie
Location: Oklahoma
Trades: 2
You will need some javascript to help you do this. I don't think it's possible with css alone.

I am not a javascript guru, so I hesitate to show this to you....but it might be helpful, so I will. I had to do something like this for a project once and here is the code that I made to do this:

Javascript:
Code:
function menu_rollover_on(explanation){
		document.getElementById('explanation_paragraph').innerHTML = explanation;
		document.getElementById('menu_explanation').style.display = "block";
		}
		
	function menu_rollover_off(){
		document.getElementById('explanation_paragraph').innerHTML = "";
		document.getElementById('menu_explanation').style.display = "none";
		}
snippet of the html:
Code:
<div id="menu_box">
       	<ul>
        	<li>
                    <a href="weekly.cfm" onmouseover="menu_rollover_on('See a preview of this weeks ad here.');" onmouseout="menu_rollover_off()">Entire Ad</a>
                </li>

                <li>
                    <a href="zoom_pan.cfm" target="_blank" onmouseover="menu_rollover_on('This option allows you to zoom into this week’s ad or drag it from side to side as needed.');" onmouseout="menu_rollover_off()">Zoom &amp; Pan</a>
                </li>
       </ul>
       
</div>

<div id="menu_explanation">
    <p id="explanation_paragraph"></p>
</div>
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 08-12-2009, 04:57 PM Re: Change div content when hovering over li
Average Talker

Posts: 29
Name: Luke
Trades: 0
I will give that method a try. In terms of SEO and cross-browser compatibility are there any drawbacks of using this method?
__________________
Luke Robinson

Please login or register to view this content. Registration is FREE
lrobinson is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Change div content when hovering over li
 

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 0.11856 seconds with 13 queries