jQuery(function($) { // replace click with mouseenter if you want to activate the map on mouse hover // warning - mobile devices don't have a cursor so they can't trigger "hover" $('.sfs-fast-map a').on('click', function(e) { e.preventDefault(); map = $(this).parent(); iframe_src = map.data('iframe-src'); iframe_width = map.data('iframe-width'); iframe_height = map.data('iframe-height'); map.html(''); return false; }); });