Problem with mouseover and mouseout in javascript in template
-
Hi there
I am customizing a template in wordpress. There is a bit of javascript in the functions file which changes a box colour on mouseover/mouseout. I changed the colours to ones more suited to my needs, however it keeps referring to the default set.
I am not sure what I am doing wrong – this is the javascript
echo ‘<script type=”text/javascript” src=”js/jquery-1.7.2.min.js”></script>
<script type=”text/javascript”>
$(document).ready(function(){
$(“div#fbox_35”).mouseover(function(){
$(this).css(“background-color”,”#274068;”);
});
$(“div#col1.box”).mouseout(function(){
$(this).css(“background-color”,”#274068″);
});
});
</script>
<script type=”text/javascript”>
$(document).ready(function(){
$(“div#fbox_34”).mouseover(function(){
$(this).css(“background-color”,”#91a833″);
});
$(“div#fbox_34”).mouseout(function(){
$(this).css(“background-color”,”#91a833″);
});
});
</script>
<script type=”text/javascript”>
$(document).ready(function(){
$(“div#fbox_33”).mouseover(function(){
$(this).css(“background-color”,”#27b1ce”);
});
$(“div#fbox_33”).mouseout(function(){
$(this).css(“background-color”,”#23c2e3″);
});
});
</script>’ . “/n”;
}I am a noob at JS so would appreciate any help or advice I can get. The colours in the script are the ones I want, but it seems to be referring to the default. Could it be calling some cached version from somewhere?
The topic ‘Problem with mouseover and mouseout in javascript in template’ is closed to new replies.