我的哈希标签转换不起作用,有什么想法吗?
我有:
//Hash tag animations
$(document).ready(function(){
$('#selectcitydd').localScroll({duration:800, hash:true});
});
这应该由选择触发:
<select id="selectcitydd">
<option selected="selected" value="http://localhost/wordpress/#afterheadindex">Tbilisi</option>
<option value="http://localhost/wordpress/gudauri/#afterheadindex">Gudauri</option>
<option value="http://localhost/wordpress/batumi/#afterheadindex">Batumi</option>
</select>
我使用这个 jquery 来触发选择 url:
// Homepage Select City function
$(document).ready(function() {
// bind change event to select
$('#selectcitydd').on('change', function () {
var url = $(this).val(); // get selected value
if (url) { // require a URL
window.location = url; // redirect
}
return false;
});
});