Jump to content

.slideDown(no worky)


niccio
 Share

Recommended Posts

I am having an issue with a .slideDown script for a greybox. Basically, when I open a file in the Greybox it does one of three things:1) BG_window pops right open without sliding anywhere2) Flashes the BG_window on then off and then slides down3) BG_window slides down correctlyI've tried it with multiple file types with no common denominator. I have received all three results with the same files!Anyhow, here is the code, I'm guessing I have something wrong in there that it causing it to not function on a normal regular basis.

//In the Greybox.js file//function GB_show(caption, url, height, width) {  GB_HEIGHT = height || 400;  GB_WIDTH = width || 400;  if(!GB_DONE) {    $(document.body)      .append("<div id='GB_overlay'></div><div id='GB_window'><div id='GB_caption'></div>"        + "<img src='greybox/print2.bmp' alt='print window'/></div>");    $("#GB_window img").click(GB_print);    $("#GB_overlay").click(GB_hide);    $(window).resize(GB_position);    GB_DONE = true;  }  $("#GB_frame").remove();  $("#GB_window").append("<iframe id='GB_frame' src='"+url+"'></iframe>");  $("#GB_caption").html(caption);  $("#GB_overlay").show();  GB_position();[b]  if(GB_ANIMATION)    $("#GB_window").slideDown("slow");  else    $("#GB_window").slideDown("slow");}[/b]function GB_hide() {  $("#GB_window").slideUp("slow");  $("#GB_overlay").hide();}function GB_print() {window.parent.frames[0].focus();window.print();}function GB_position() {  var de = document.documentElement;  var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;  $("#GB_window").css({width:GB_WIDTH+"px",height:GB_HEIGHT+"px",    left: ((w - GB_WIDTH)/2)+"px" });  $("#GB_frame").css("height",GB_HEIGHT - 32 +"px");}//initialization code in main page//<script type="text/javascript">       var GB_ANIMATION = true;      $(document).ready(function(){        $("a.greybox").click(function(){          var t = this.title || $(this).text() || this.href;          GB_show(t,this.href,800,1000);          return false;        });      });</script>

BTW - the:function GB_hide() { $("#GB_window").slideUp("slow"); $("#GB_overlay").hide();}works perfectly. Any ideas on what could be causing the anomoly? I've been trying to troubleshoot it for almost a week!

Link to comment
Share on other sites

I know, I just put that in there to troubleshoot, I probably should have put it back to the way it was before posting! It's typically: if(GB_ANIMATION) $("#GB_window").slideDown("slow"); else $("#GB_window").show();I don't receive any error messages regardless of what it's doing.

Edited by niccio
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...