garevn Posted February 3, 2013 Share Posted February 3, 2013 This is my current code, but i want a mouseover and mouseout behaviour to a text with no "read more" "read less" "images" ets.For exampleLine one....Line two....when mouseover in the table/div with the text, display:Line one....Line two....Line three...Line four...when mouseout display back two lines <script type="text/javascript">function showMoreOrLess(thisObj,bonusContent){ var caption = thisObj.innerHTML; //alert(caption); if ( caption == "Read more" ) { document.getElementById(bonusContent).style.display = "inline"; thisObj.innerHTML = "Read less"; } else { document.getElementById(bonusContent).style.display = "none"; thisObj.innerHTML = "Read more"; }}</script></head><body><div id="restOfArticle" style="display:none">blah blah</div><a onmouseover="showMoreOrLess(this,'restOfArticle');">Read more</a></body> Link to comment Share on other sites More sharing options...
jeffman Posted February 3, 2013 Share Posted February 3, 2013 You'll need to have SOME element that can always be displayed. That will be the thing users mouseover/mouseout. An element with display:none does not register mouse events. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now