having problem with one of the scripts below, which stops working right after the pretty photo script is executed.
Any idea why this is happening and how to fix it?
thanks in advance
<script type="text/javascript">
$(function(){
$(window).scroll(function(){
if ($(window).scrollTop() > 90) {
$("nav").addClass("sticky");
$(".menu_logo").css("display", "block");
$(".menu_logo").html('<a href="/" title="Home"><img src="/images/_logo_sm.png" alt="" width="108" height="25" /></a>');
$("#menu-bar").css("display", "block");
$("#menu-bar").html('<div id="menu-bar-icon" ></div>');
$("#menu-bar-icon").click(function() {
$('#menu').toggle();return false;
});
$("#menu").css("display", "none");
$('#search_in_bar').html($('#search').html());
} else {
$("nav").removeClass("sticky");
$(".menu_logo").css("display", "none");
$("#menu").css("display", "block");
$('#search_in_bar').empty().html();
$("#menu-bar").css("display", "none");
}
});
});
</script>
I took a look at your code. There were a few things that needed modification but I won't name them all.
<img>
tag for the screen shot wasn't closed: <a href="..." rel="..."><img src"..." /></a>
rel="prettyPhoto[]"
is used for multiple images. rel="prettyPhoto"
is for just one image.$('#search_in_bar').empty().html();
Makes no sense; emptying the contents of the <div>
then asking for it's content.pps.js
was not being loaded but was met with a 403 (Forbidden) error. <script> $(function() { $("a[rel^='prettyPhoto']").prettyPhoto(); $(window).scroll(function (){ ... }); }); </script>
Oh, side note:
<a href="large_here.png" rel="prettyPhoto"> <img src="smaller_here.png" /></a>
Working jsFiddle