javascript - JQuery .hover / .on('mouseleave') not functioning properly -


i trying use hover function pretty rudimentary, can't seem mouseout/mouseleave function properly.

code:

$(document).ready(function(){  $('.slist').css('display','none');  $(".mlist a").on('mouseenter',   function(){     var htmlarr = $(this).children().html().split(':');      $(this).children('p').replacewith('<p>'+htmlarr[0]+':&nbsp&#9700;</p>');     $(this).siblings('.slist').slidedown('slow');   })   .on('mouseleave',function(){     var htmlarr = $(this).children().html().split(':');      $(this).children('p').replacewith('<p>'+htmlarr[0]+':&nbsp&#9698;</p>');     $(this).siblings('.slist').slideup('slow');   }); }); 

the mouseenter works properly, not entering code mouseleave. ideas appreciated.

fiddle

see this: demo

$(".mlist a").on('mouseenter',  function(){   var html = $(this).children('p').html();    $(this).children('p').html(html.replace('◢','◤'));   $(this).siblings('.slist').slidedown('slow'); }) .on('mouseleave',function(){   var html = $(this).children('p').html();    $(this).children('p').html(html.replace('◤','◢'));   $(this).siblings('.slist').slideup('slow'); }); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -