PDA

View Full Version : Onmouse hover not working on



somerfeld
07-20-2011, 02:55 AM
1) Script Title: Switch Content I

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

3) Describe problem:
Trying to find a way for hover to work,. but no matter what i do i cannot get it to function i have tried this and many other variations.. can you help me ? I'm im not having a stupid moment :eek:



<script type="text/javascript" src="http://www.dynamicdrive.com/dynamicindex17/switchcontent.js" ></script>
<style type="text/css">
.handcursorsub
{
cursor:hand;
cursor:pointer;
color: #E8E8E8;
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
text-decoration: none;
}
.handcursorsubhover
{
cursor:hand;
cursor:pointer;
color: #92C7F2;
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
text-decoration: none;
}
</style>
</head>
<body>

<span id="1-title" onmouseover="this.className='handcursorsubover'"
onmouseout="this.className='handcursorsub' onClick="Toggle(this)">foo foo has a question</span>
<div id="1" class="faq"><h5>
bar bar has a answer
</h5></div>
<script type="text/javascript">
// MAIN FUNCTION: new switchcontent("class name", "[optional_element_type_to_scan_for]") REQUIRED
// Call Instance.init() at the very end. REQUIRED

var faq=new switchcontent("faq", "div") //Limit scanning of switch contents to just "div" elements
faq.setStatus('', '')
faq.setColor('white', 'white')
faq.setPersist(false)
faq.collapsePrevious(true) //Only one content open at any given time
faq.defaultExpanded()
faq.init()
</script>


but with no success

jscheuer1
07-20-2011, 06:18 AM
<script type="text/javascript" src="http://www.dynamicdrive.com/dynamicindex17/switchcontent.js" ></script>
<style type="text/css">
.handcursorsub
{
cursor:pointer;
color: #E8E8E8 !important;
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
}
.handcursorsubhover
{
cursor:pointer;
color: #92C7F2 !important;
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
}
</style>
</head>
<body>

<span id="1-title" class="handcursorsub" onmouseover="this.className='handcursorsubhover'"
onmouseout="this.className='handcursorsub'" onClick="Toggle(this)">foo foo has a question</span>
<div id="1" class="faq"><h5>
bar bar has a answer
</h5></div>
<script type="text/javascript">
// MAIN FUNCTION: new switchcontent("class name", "[optional_element_type_to_scan_for]") REQUIRED
// Call Instance.init() at the very end. REQUIRED

var faq=new switchcontent("faq", "div") //Limit scanning of switch contents to just "div" elements
faq.setStatus('', '')
faq.setColor('white', 'white')
faq.setPersist(false)
faq.collapsePrevious(true) //Only one content open at any given time
faq.defaultExpanded()
faq.init()
</script>

somerfeld
07-20-2011, 07:55 AM
still cannot get that to work? did you have success with that code?

here the page i have been trying to get it to work on

http://heroesmf.com/v2/visitors.php

jscheuer1
07-20-2011, 08:53 AM
Yes...

somerfeld
07-20-2011, 03:58 PM
ahh yes it does in a stand alone file.. what do you think my be causeing the css not to work with the css styles in my header? in http://heroesmf.com/v2/test.php

somerfeld
07-20-2011, 07:32 PM
oops had santax error,. thanks for your help