[jQuery] Trying to pass vars from multiple triggers
Hi I have multiple triggers and I am trying to pass variables via a
"rel=" tag (which are unique id's) for each trigger
I can get most of it working, problem is that since there are multiple
triggers with id="newsTrigger" only the first listed trigger works
Using PHP/mySQL.
An example trigger is:
while loop{
echo '<span id="newsTrigger" style="font-size:0.8em;" rel="'.
$rowNewsid[$counter].'"><a href="'.$rowNewsPermalink
[$counter].'">'.substr($rowNewsHeadline[$counter],0,40).'</a></span>';
}
The above outputs a large number of rows with the same span id of
"newsTrigger". When a user mousesover any of the newsTrigges I am
trying to get an ajax dialog to load up content based on the id that
is being passed through the rel tag. How do I do this?
The javascript so far is:
<script>
$(document).ready(function(){
$("#newsTrigger").mouseover(function() {
var newsid = $(this).attr("rel");
alert(newsid);
});
});
</script>