Tag: area

用jqueryhover地图区域精灵

我正在研究我的第一个真正的wordpress网站,我遇到了一些问题。 我真的希望有人可以帮助我。 所以我想要做的是根据当前hover的地图区域来定位我的div背景。 我在这里找到了一个例子: http : //ubytujnaslovensku.sk/sk/ 我得到了什么:HTML: CSS #front-cubus-wrapper{ width:355px; height:365px; position:relative; } #front-cubus{ width:355px; height:365px; position: absolute; background-image:url(images/insighttoimprove_website_cubus_index.png); z-index:1; } #front-cubus-hover{ width:355px; height:365px; position: absolute; background-image:url(images/insighttoimprove_website_cubus_index_hover.png); background-repeat:no-repeat; z-index:2; } #front-cubus-wrapper img{ position:absolute; width:355px; height:365px; z-index:3; } jQuery的: jQuery(document).ready(function($){ var default_value = $(“#front-cubus-hover”).css(“background-position”); if (default_value === “0px 0px”) { $(‘#map area’).each(function() { $(this).hover( function() […]

我可以在imagemap区域元素上有一个onclick事件

我想在一个区域元素上放一个onclick事件。 这是我的设置: 我尝试了两种不同的方式来进行onclick事件。 首先我试过这个: $(“.blue”).click( function(event){ alert(‘test’); }); 我也试过这个: function myFunction() { alert(‘test’); } 以上工作都没有。 区域元素是否支持上述元素,或者它们仅支持具有href? 提前致谢!