javascript - jQuery , changing value with live odds -
javascript - jQuery , changing value with live odds -
this 1st time posting here, sorry if i'm not gonna clear wiht question first shoot :). ok, allow me explain i'm stuck. got portal odds can changed second, means, if u pick 1 odd now, can changed second, means u have alter bet on odd.
this site best illustration of wanna get. http://www1.betuniq.eu/it/live (pick match u can see odds betting)
when pick odd, odd hovered css class, when same odd alter it's value, hover disappears. wanna next. when odd alter value wanna color of hover ?!
in short, thats problem. hope wrote understandable.
kind regards
it can done jquery. it's this. not elegant way, maybe else can suggest littlebit more clear solution. till time, can check this:
jquery
<script type="text/javascript"> $(function() { $('.odd').click(function() { if (!$(this).hasclass('clicked')) { $(this).addclass('clicked'); $(this).css('background-color', "#00f"); } }); $(".odd").hover(function() { if (!$(this).hasclass('clicked')) { $(this).css('background-color', "#f00"); } }, function() { if (!$(this).hasclass('clicked')) { $(this).css('background-color', "#fff"); } }); }); </script>
css
<style> div.odd {border: 1px solid #000; padding: 2px; display: inline-block; cursor: pointer} </style>
html
<div class="odd">this text</div>
javascript jquery html css knockout.js
Comments
Post a Comment