JavaScript - Jquery Fancybox - Inline Content Not Updating...
I moved this to a more appropriate place...
http://www.codingforums.com/showthread.php?t=184432 Similar TutorialsAll, I've got the following bit of code: Code: $(function(){ $(".facebook").fancybox({ 'width' : '80%', 'height' : '80%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'hideOnOverlayClick' : false, 'hideOnContentClick' : false, 'type' : 'iframe' }); }); When I click on a link I'm trying to open up an iFrame to have my user have some facebook photos be displayed. If they aren't logged in I redirect them to facebook to login and then facebook redirects them back to my page. The return URL looks something like: http://website.com/get_started.php?page=facebook What I would like to do is open up the same iFrame now with their pictures. So I have the following code to do that: Code: function showFacebook(){ alert("goes to show facebook"); $(".facebook").trigger('click'); } function parseQS(str){ var ob={}, float="", key="", dc=decodeURIComponent; for( var i=0, mx=str.length; i<mx;i++){ var it=str[i]; if(it==="="){ key=float; float=""; continue;} if(!it.search(/^[?&]/)){ if(it==="&" && str.slice(i+1,i+5)==="amp;"){ i=(i+4);float+="&"; continue;} if(key){ob[key]=dc(float);} key=""; float=""; continue; } float+=it; } ob[key]=dc(float); return ob; } $(window).load(function(){ var allParams=parseQS(location.href); if(allParams.page!=undefined){ if(allParams.page=="facebook"){ $(".facebook").fancybox({ 'width' : '80%', 'height' : '80%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'hideOnOverlayClick' : false, 'hideOnContentClick' : false, 'type' : 'iframe' }); showFacebook(); } } }); I can't get the iFrame to load again. In my window.load function I'm basically trying to reinitialize the fancybox iframe code and then based on the link he http://fancybox.net/blog I'm trying to trigger it again. The alert appears so I know it's getting to the function but it's not opening up the iFrame. Any ideas on how to make this happen? Thanks very much in advance! Ok, I would post my entire data here but then yall would be reading insane amounts of script. I've got a div content jquery slider on my site I am making and it works beautifully in all browsers(took me a while). Then, I decided why not have it where when people click on a "read more" link that it pops up a box, instead of directing to the new page, and displays the contents of a div. It would not work at all. My question is there a possible way to do this?
Hello! So I came across this Featured Content Slider mod (http://css-tricks.com/creating-a-sli...ontent-slider/) which is based on the Coda Slider (http://www.ndoherty.biz/demos-index/) which uses jQuery. However, you'll notice that the Coda Slider has since received an update (2.0). What I'm trying to do is update the mod for the Coda Slider update, which I'll then use to create a WordPress plugin for my site. Thing is, I don't really know JavaScript (only enough to logic my way through simply stuff). A lot of things seemed to have changed in the Coda update, but I can't seem to get things to work properly in the FCS, specifically being able to click a thumbnail and make the slider switch to that one. I'm pretty sure I've ruled out CSS being an issue, leaving the JavaScipt. If anyone's willing to take a look, I've uploaded what I currently have to http://www.thetanooki.com/coda.zip It's a bit rough at the moment, since I'm pretty much using trial and error to figure things out... and don't mind the seemingly useless PHP code at the top of the .js.php file - that's just an example I'm hoping to use for when I eventually make a WordPress plugin out of it. Anyway, index2.html is the one I'm working on, I'm only using index.html (original) as a guide, and the original FCS as well as old version of Coda can be found at the other links above. Thanks in advance; any light that can be shed on this would be a tremendous help! If I've screwed something else up, let me know - I may have overlooked conflicting class names or something like that since the originals aren't my own code and I'm still familiarizing myself. Hello. I'm creating a simple auto updating script based on PHP and using jQuery to set the interval to 1000 miliseconds. It works in FireFox, as the only one I've tested so far, but in Internet Explorer (Version 7 right now, didn't test others) it just freezes and doesn't auto update. Doesn't auto update either if I refresh the page, so something's messed up here. I'm using the same way of auto updating on other things, such as a chat-page - works on those in all browsers, so I'm kinda on a lost track here. Here's the JavaScript/jQuery: Code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> function loadContent() { $('#count').load('counter.php', function() { setTimeout("loadContent()", 1000); }); return false; } $(loadContent); And this is what I put on the body of the page: Code: <div id="count"></div> Can anyone see what my problem is? And any workarounds for this? Resolved
when someone selects a date it shows ok in the field but the checker script can not view it for some reason, i have an alert show the content, if i place the alert before everything it unblurs and the tick shows, but i have to click the alert off for the tick to show. The alert show nothing on the first run. just a thought, but would the DOM not be updating quick enough for the next line to read the content ? reason i ask is that with the alert line in the code it shows the previous state of the field when i change the date to something else. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type='text/javascript'> function checkValidFormInput() { redX = '<img alt="Invalid" src="images/redX.png" style="width: 18px;">'; greenTick = '<img alt="Valid" src="images/icongreentick.png">'; alert('.' + document.getElementsByName('j1date')[0].value + '.'); document.getElementsByName('j1date').blur(); if (document.getElementsByName('j1date')[0].value == '') { document.getElementById('j1dateImg').innerHTML = redX;// } else { document.getElementById('j1dateImg').innerHTML = greenTick;// } } </script> </head> <body> <? // for some strange reason the following lines need to be here for the date picker to work! ?> <table class="ds_box" cellpadding="0" cellspacing="0" id="ds_conclass" style="display: none;"> <tr><td id="ds_calclass"></td></tr> </table> <script type="text/javascript" src="datetimepicker.js"></script> <? // end of date picker storage ?> <form method="POST" action="index.php"> <li class="value"> <input type="text" autocomplete="off" name="j1date" id="j1date" value="<?=$j1date;?>" style="width: 200px; float: left;" onClick="ds_sh(this);" onBlur="checkValidFormInput();"> <div style="float: left;" id="j1dateImg"></div><br style="clear:both"> </li> </form> </body> </html> attached is the datetimepicker.js you will need to remove the last part .txt from the above file name Hi, I wish to get some content from another page. Here is my code. Code: <script type="text/javascript"> jQuery.ajax({url: 'http://www.livecounter.dk/viewstats/30050',type: 'get',success: function(ajax) { var x = jQuery('#box4 .first:last', ajax).innerHTML; document.write(x); } } }); </script> <script src="http://code.jquery.com/jquery-1.6.1.min.js"> </script> But it isn't working. I can't get the at this page : http://www.livecounter.dk/viewstats/30050 under "Altid" (to the right), next to "Sidevisninger". Image of it here : http://i51.tinypic.com/2e0sb9s.png Thanks Hello Guru's, I hope someone can help me with the following. I have a div on a page, with content (images, text), I want to rescale it by using a slider. I have this code sample which allows to rescale, rotate, skew, but I only want to use the rescale option, and use it with a slider instead of using the small magnifying glass icon on the right bottom corner. I've have add the files as attachment and hope someone can help me with this. Thanks. I've seen this really nice slider on www.formfiftyfive.com (when you click the links at the top i.e about, it will drop down revealing content) It moves the entire site rather than just overlay. I really like this and would love to implement it into my site? Any ideas what it is and how I can use it? Does anyone have a solution? The first image works fine, but obviously when the image is changed by the second function it will not work???? Code: <script type="text/javascript"> jQuery(document).ready(function(){ $("a#single_image").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'speedIn' : 600, 'speedOut' : 200, 'overlayShow' : false }); }); </script> </head> <body> <div class="hidden"> <script type="text/javascript"> $(function() { $(".image").click(function() { var image = $(this).attr("rel"); var large = $(this).attr("title"); $('#image').hide(); $('#image').fadeIn('slow'); $('#image').html('<a href="' + large + '" id="single_image"><img src="' + image + '"/></a>'); return false; }); }); </script> Hi, Does anyone know if in FancyBox there is an option to always show the side arrows on image pop ups? http://fancybox.net/ Hi, I am using fancybox to display a contact form in a lightbox here http://bit.ly/i5TwmL this is working in Firefox and Safari but not in IE, I have no idea why. If anyone has any suggestions on how to get this to work it will be more than appreciated! Many Thanks, Ria please see http://bit.ly/i5TwmL for what I am working on. You can see that when selecting 'Contact' from the top navigation a light-box (fancybox) with a contact form opens, this form can be filled and when the submit button is pressed the content of the form is emailed to myself. However.... The 'Thank you message' is not appearing in the light-box as I would like it to and I cannot work out how to do this. Any suggestions muchly appreciated! All, I'm opening up a page using Fancybox: Code: $("#register_box").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'hideOnOverlayClick': false, /*'type' : 'iframe',*/ 'autoDimensions' : true }); This works fine and opens up my registration page. However when I have the type commented it won't display my reCaptcha. If I uncomment this in my jQuery then it will display the reCaptcha. Any ideas to why this is? Thanks in advance for any ideas. I did find this link: http://www.warpturn.com/using-fancybox-with-recaptcha/ This doesn't help me though because I need it to load without the iFrame but could give some direction on what is going on. Hey everyone, I've got a section on my website where I have 2 images placed on top of each other when the user rollovers the image, the image ontop fades out revealing the image underneath. You can then click on this underneath image to open a fancybox window and scroll through pictures. My problem is that sometimes the fade out gets 'stuck' and after closing the fancybox window, the image reamins half faded out etc and the rollover doesn't work anymore. here's my code: Code: <style type="text/css" media="screen"> .js #animators { position: relative; height: 100px} .js #animators div.container { position: absolute; left: 0; top: 0 </style> <script type="text/javascript"> document.documentElement.className += " js"; // Add js class to the HTML element $(function(){ var $containers = $("#animators > div").hide(); $('#show').show(); $('tr td a.c').each(function(i,el){ var idx = i; $(this).click(function(e){ var $target = $containers.filter(':eq(' + idx + ')'); if($containers.filter(':visible').not($target).length){ $containers.filter(':visible').fadeOut(); } $target.not(':visible').fadeIn(); e.preventDefault(); }) }) }); </script> <div class="thumbnail" style="margin-top:5%; margin-right:2%;"> <div class="visible-image"> <img src="images/illustrationslabel.jpg" /> </div> <div class="appearing-image"><img onclick='$("a.illustrations:first").trigger("click");' src="images/illustrations.jpg" /> </div> </div> mc I am creating a site that has a link with sIFR text that links into inline content via Fancybox. I know it works properly withour sIFR on, so the two are battling. Is there any way to have both?? url: www.happydogwebproductions.com/cadillac The contact link is supposed to pop up via fancybox. You can get it to load if you are quick enough to click it before sIFR kicks in. I've tried asking elsewhere, got over 100 views and not one reply. Any help would be greatly appreciated Hello! I am not sure if I'm posting in the right place so if I'm not, tell me to gtfo (and please let me know where I should be instead)! I want to create a gallery of images with a fancybox-esque style but incorporate the "folder functionality" that this site has: http://www.johannespescatore.com/ In other words: When I click on an image I want it to expand to "fullscreen". (This I can manage with fancybox.) What I can't work out how to do is display more images from the same photo-session at the bottom of the fullscreen. ANY help would be much appreciated! I am at a loss as where to start... Thank you /Hout Hi, im using this code as a fancybox replacement for confirm. Code: function fancyAlert(msg) { jQuery.fancybox({ 'modal' : true, 'content' : "<div style=\"margin:1px;width:240px;\">"+msg+"<div style=\"text-align:right;margin-top:10px;\"><input style=\"margin:3px;padding:0px;\" type=\"button\" onclick=\"jQuery.fancybox.close();\" value=\"Ok\"></div></div>" }); } function fancyConfirm(msg,callback) { var ret; jQuery.fancybox({ modal : true, content : "<div style=\"margin:1px;width:240px;\">"+msg+"<div style=\"text-align:right;margin-top:10px;\"><input id=\"fancyConfirm_cancel\" style=\"margin:3px;padding:0px;\" type=\"button\" value=\"Cancel\"><input id=\"fancyConfirm_ok\" style=\"margin:3px;padding:0px;\" type=\"button\" value=\"Ok\"></div></div>", onComplete : function() { jQuery("#fancyConfirm_cancel").click(function() { ret = false; jQuery.fancybox.close(); }) jQuery("#fancyConfirm_ok").click(function() { ret = true; jQuery.fancybox.close(); }) }, onClosed : function() { callback.call(this,ret); } }); } function fancyConfirm_text() { fancyConfirm("Ceci est un test", function(ret) { alert(ret) }) } how can i use fancyConfirm via an onclick in a hyperlink? thanks for your help! Hey there, I have a form which open in a jQuery Fancybox Window. The fancybox window opens automatically when the page loads. When it loads, I would like it to set focus on the username field in the form in the Fancybox window. I have found that this must be done when fancybox is envoked, thus I have tried the below code which does not work : Code: <script type="text/javascript"> jQuery(document).ready(function() { $("#hidden_link").trigger('click'); document.getElementById('login_form.username').focus(); }); </script> The form name is "login_form" and the field name is "username". Can anyone help???? Thanks a lot!!! I have a page that loads a fancybox popup and it works perfectly with the cookie for setting ho many days to show. the problem i have is that i need it to show 1 every 24 hours over a 3 day period. once the 3rd day is over and the user sees the window for the 3rd day i need a cookie set to never show the window again. here is my code as it sits now. I have worked with this for a couple of days on and off and it is above my head for sure. any help is appreciated. $(function() { if ($.cookie('moment_comm')) { // it hasn't been 1 day yet } else { $("#autostart").fancybox({'overlayShow':true,frameWidth: 840,frameHeight:360}).trigger('click'); } } ); $('#autostart').live('click', function(e) { e.preventDefault(); $.cookie("moment_comm", "true", { path: '/', expires: 1 }); $.fancybox.close() }); |