Note that there are some explanatory texts on larger screens.

plurals
  1. PORollover delay for Map markers
    primarykey
    data
    text
    <p>We had a developer work-up a piece of javascript for animating markers on a map for us. See <a href="http://luniablue.com/clients/endowment" rel="nofollow">http://luniablue.com/clients/endowment</a> for it's current state.</p> <p>The issue I'm having, is that the rollover is too sensitive and I want there to be a 1sec pause before executing the rollover function. From what I've read, I need to declare a setTimeout() function, but I'm not clear on where to insert that.</p> <p>I have tried every place that I can see and I've had no luck except in breaking the script. I'm sure it's something stupid simple, but javascript isn't my stong point. Can anyone help me out?</p> <p>Here's the code:</p> <pre><code>var firstEntry = true; var lastOn = ''; function showAllPins() { if ($('#communities').hasClass('theMouseIsOff')) { var citiesArr = []; $('.pin').each( function () { citiesArr.push(this.id); $('#'+this.id).hide(); }); var stillHidden = citiesArr.length; while (stillHidden &gt; 0) { var a = Math.floor(Math.random()*citiesArr.length); if ($('#'+citiesArr[a]).is(':hidden')) { $('#'+citiesArr[a]).show().delay(Math.floor(Math.random()*900)).animate({ opacity: 1, top: '+=40', }, Math.floor(Math.random()*900), 'easeOutBounce'); stillHidden--; } } firstEntry = true; $('#communities').removeClass('theMouseIsOff'); } } function showPin(relid){ lastOn = relid; if ($('#communities').hasClass('theMouseIsOff')) $('#communities').removeClass('theMouseIsOff'); if (firstEntry == true) { $("#communities div[id!=" + relid + "].pin").animate({ opacity: 0, top: '-=40', }, 500); firstEntry = false; } else { $("#communities div[id=" + relid + "].pin").animate({ opacity: 1, top: '+=40', }, 500, 'easeOutBounce'); } } function removeLastPin() { $('#communities').addClass('theMouseIsOff'); $("#communities div[id=" + lastOn + "].pin").animate({ opacity: 0, top: '-=40', }, 500); setTimeout('showAllPins()',600); } $(document).ready( function () { $('.pin').mouseenter( function () { relid = $(this).attr('rel'); showPin(relid); }).mouseleave( function () { removeLastPin() }); }); $(document).ready(function() { $('.pin').each(function() { var selector = '#' + $(this).data('tooltip-id'); Tipped.create(this, $(selector)[0], { skin: 'light', hook: { target: 'topmiddle', tooltip: 'bottomleft'}}); }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload