I’m making a website that uses a Javascript sorter. In addition to the sorter, I also put in some custom javascript, to make certain div’s clickable. My reasoning was that using the property just couldn’t do all that we wanted it to do, so I stuck with divs, and used javascript to make them function.
Take a look here —
http://www.opohills.com/taipei-rentals.php
You can scroll down to where you see the search bar, and click on one of the apartments. When you go back click (1 bedroom), you’ll see that clicking on the apartments doesn’t work anymore.
I’m not quite sure what to make of this at all. The javascript for the clickability is at the bottom of the page.
What are your thoughts on this?
Here’s my javasscript
<script type='text/javascript'>
$(".box_1").click(function(){
window.location=$(this).find("a").attr("href");
return false;
});
$(".box_2").click(function(){
window.location=$(this).find("a").attr("href");
return false;
});
$(".box_3").click(function(){
window.location=$(this).find("a").attr("href");
return false;
});
$(".apt2").click(function(){
window.location=$(this).find("a").attr("href");
return false;
});
</script>
Thoughts?
UPDATE
In accordance to the suggestions, I’ve updated the code by moving the javascript for clickability above jquery.quicksand, and initiated it only after the document was ready.
Even with these changes, I’m still having trouble getting it to work.
The latest version of the site can be seen here—
http://www.opohills.com/taipei-rentals.php
Your thoughts greatly appreciated
So you can try to edit our file sorter-settings.js and replace by this code (based on the documentation available here (http://razorjack.net/quicksand/docs-and-demos.html) :
Additinaly, I think that this code is useless on your html content.