Jump to content

on hover show the list


deepson2

Recommended Posts

Hello,

 

I wanted to show on hover my record list. But it seems its not working. can anyone see my code and tell me what is wrong  am doing?

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<script>

/* when the dom is ready... */
window.addEvent('domready',function() {
/* hide all controls right away */
$$('div.record-controls').setStyle('visibility','hidden');
/* add events for show/hide */
$$('div.record').each(function(rec) {
	var controls = rec.getFirst('div.record-controls');
	rec.addEvents({
		mouseenter: function() { controls.fade('in') },
		mouseleave: function() { controls.fade('out') }
	});
});
});
</script>
<style>
<link >
.record				{ width:700px; border:1px solid #ccc; padding:15px; margin:0 0 15px 0; }
.record:hover		{ background:#eee; }
.record-controls	{ font-size:10px; }
.unapprove			{ color:#d98500; }
.delete				{ color:#bc0b0b; }
</style>
</head>
<body>
<!-- more records above -->
<div class="record">
<p>
	<strong>Comment Person 2</strong><br />
	Hello world!
</p>
<div class="record-controls">
	<a href="#" class="unapprove">Unapprove</a> |
	<a href="#">Edit</a> |
	<a href="#">Reply</a> |
	<a href="#">Spam</a> |
	<a href="#" class="delete">Delete</a>
</div>
</div>
<div class="record">
<p>
	<strong>Comment Person 3</strong><br />
	hello!
</p>
<div class="record-controls">
	<a href="#" class="unapprove">Unapprove</a> |
	<a href="#">Edit</a> |
	<a href="#">Reply</a> |
	<a href="#">Spam</a> |
	<a href="#" class="delete">Delete</a>
</div>
</div>
<!-- more records below -->
</body>
</html>

 

Thanks in advance.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.