fancybox

Fancybox force scroll to top

一世执手 提交于 2019-12-10 11:46:16
问题 I'm using the jQuery Fancybox plugin to display some content on a website. Unfortunately, when a link is clicked, the lightbox that is loaded starts at the same scroll position as the previous one. I tried using self.scrollTo(0,0) $.scrollTo(0) $('#top').scrollTo(); and a few others methods to push it back to the top, but none have seemed to work. Any help on this? 回答1: Does Fancybox have some sort of a callback? The reason I ask is, the lightbox is probably resetting the scroll back to the

Fancybox - javascript to detect mobile orientation and launch advisory pop-up if portrait

风格不统一 提交于 2019-12-10 11:28:58
问题 I've got the fancybox pop-up to launch OK, but for now only in response to: if (window.innerWidth < 400 && window.innerHeight < 600) See example here: www.casedasole.it/testing/popup.html If you reload the page at less than 400px width, the popup pops up. But what I need is to change the "if" to whatever indicates that the mobile is in portrait mode. Then the pop-up will say something like: "This website looks better in landscape". I've found references to orientationchange events, but

I can't get Backbone.js events to trigger when the View is within a Fancybox

江枫思渺然 提交于 2019-12-10 10:48:45
问题 I have a Backbone View that renders within a Fancybox. I can click on an anchor tag and it will work but events in the Backbone view won't trigger. I've had the same problem with ShadowBox and another lightbox that I can't remember. Any thoughts? var LightboxItemView = Backbone.View.extend({ className : 'lighbox-item', events : { "click .lightbox-preview" : "visitItemPage" }, initialize : function() { _.bindAll(this, "render"); this.render(); }, visitItemPage : function() { console.log(

Google static map image with link to Google iframe

本小妞迷上赌 提交于 2019-12-10 10:48:19
问题 I am trying to display a google static map, which when clicked, will open up a larger iframe, where the user can pan, zoom, etc. JSFiddle here Code below: <div> <a class="various fancybox.iframe" title="Whitehouse - USA" href="https://maps.google.com/maps?f=d&source=s_d&saddr=&daddr=1600+Pennsylvania+Ave+NW,+White+House,+Washington,+DC+20500&hl=en&geocode=Ca3jx5Eq6BcjFQ6IUQIdG4Ro-ynPaZnjvLe3iTGGOSyaFzTP2g&sll=38.897678,-77.036517&sspn=0.009644,0.01443&g=1600+Pennsylvania+Avenue+Northwest,

Open fancyBox automatically?

强颜欢笑 提交于 2019-12-10 10:09:43
问题 I'm currently working on trying to get the fancyBox jQuery plugin to open up automatically as soon as the front page of my site loads. I'm very new to Javascript and jQuery and need some pointers. I have the below code in between my HEAD tags. Just wondering if there's something else I can insert in here to I can get fancyBox to open up when the page loads. <script type="text/javascript"> $(document).ready(function() { $(".fancybox").fancybox(); }); </script> I found the following API method

Close fancybox popup when youtube video finish

↘锁芯ラ 提交于 2019-12-10 10:04:16
问题 i did a popup with youtube video at page load. I need that the popup close when the video finish...is it possible to integrate this script? This is the code: <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="jquery.fancybox-1.3.1.js"></script> <link rel="stylesheet" type="text/css" href="jquery.fancybox-1.3.1.css" media="screen" /> <script type="text/javascript"> $(document).ready(function() { $("#yt").click(function(

HTML5 Video with Fancybox

杀马特。学长 韩版系。学妹 提交于 2019-12-10 09:52:13
问题 I am having an issue with getting HTML5 video to autoplay on load into Fancybox. I have an HTML5 video loaded into a div that is hidden and therefore can't have autoplay enabled in the tag. I then call it one an image click with a Fancybox inline and a ref to the div. Everything works as it should except I just want the video to play when then Fancybox opens it?? Any ideas would be appreciated. 回答1: You can autoplay the video as soon as it is opened in fancybox. The problem with the inline

Fancybox shifts to the right and down a few pixels after loading

痞子三分冷 提交于 2019-12-10 09:40:42
问题 I'm using Fancybox to open an iframe and it works fine in all browsers except for ie. When ie opens the iframe it seems to stagger for a split second and then it shifts the modal box to the right and down a few pixels. I came across a few people's posts but their answers didn't help. I also played around with the CSS with no success. Anyone came across anything like this before? Cheers! 回答1: Hope my solution will help to anyone who still face the same issue... I use fancybox 1.x and my

How to determine when fancybox is open?

旧街凉风 提交于 2019-12-10 02:52:22
问题 I need to know that fancybox has been open up that to allow or deny another function to start. Build-in functions Fancybox like 'onStart' or 'onClosed' not work. I'm talking about version 1.3.0 RC2 回答1: The version your using apparently doesn't match the documentation; I looked at the source and saw the names of the options were different the the online docs. I just tested the following with 1.3RC2: $(document).ready(function() { function myStartFunction() { alert('fancy box opened'); } $("a

Fancybox on CDN

放肆的年华 提交于 2019-12-10 00:48:21
问题 Is there fancybox available anywhere on the CDN? Thanks. 回答1: There is Yandex CDN (http://www.yandex.com/--big russian search engine) Available Versions: 1.3.4, 1.3.1 Path: http://yandex.st/jquery/fancybox/1.3.4/jquery.fancybox.min.js 回答2: Yup, looks like it got added to cdnjs.com on Jan. 3 2012! The website hasn't been updated with the info but here's the link to the Fancybox 2.0 library: http://cdnjs.cloudflare.com/ajax/libs/fancybox/2.0.4/jquery.fancybox.pack.js 回答3: No there isn't, but