在项目中使用lightbox跟自己得js代码有冲突

图片说明
这是页面引用的js和css文件,这样的话页面就会报错图片说明

把关于lightbox的js文件给注释掉我的js就不会报错,这是什么问题

1个回答

尽量把你的js放在最后,把组件库移到前面

sunny_desmond
carrykingdow 回复1024sdx: 在你的代码里打个断点呢 应该是调用的时候名字冲突了
3 天之前 回复
qq1696518615
1024sdx 我的js放后面了,浏览器控制台也不报错了,但是我的js还是没有效果
4 天之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Python+OpenCV计算机视觉

Python+OpenCV计算机视觉

将表单和HTML添加到lightbox.js中的Lightbox.prototype

<div class="post-text" itemprop="text"> <p>I have need to build a code just like Facebook does for pictures. Im talking about the "pop" or Lightbox they use so in the right side you can comment, in this case I would send an e+mail, and insert a random image on the bottom.</p> <p>I was also thinking in colorbox, but I use a inline html and if the user want to go from previous to next pictures I will be very lost as I dont know how to do this in Colorbox (including a form and not just images), </p> <p>Anyway the contact form is the same for all pictures. Each user will have 8 pictures and 1 contact form, thats already done. I need to make or build a Lightbox like the one used by Facebook.</p> <p>Thats why I found inside the lightbox.js (my other option) the part where the HTML forms it self here:</p> <pre><code> Lightbox.prototype.build = function() { var $lightbox, _this = this; $("&lt;div&gt;", { id: 'lightboxOverlay' }).after($('&lt;div/&gt;', { id: 'lightbox' }).append($('&lt;div/&gt;', { "class": 'lb-outerContainer' }).append($('&lt;div/&gt;', { "class": 'lb-container' }).append($('&lt;img/&gt;', { "class": 'lb-image' }), $('&lt;div/&gt;', { "class": 'lb-nav' }).append($('&lt;a/&gt;', { "class": 'lb-prev' }), $('&lt;a/&gt;', { "class": 'lb-next' })), $('&lt;div/&gt;', { "class": 'lb-loader' }).append($('&lt;a/&gt;', { "class": 'lb-cancel' }).append($('&lt;img/&gt;', { src: this.options.fileLoadingImage }))))), $('&lt;div/&gt;', { "class": 'lb-dataContainer' }).append($('&lt;div/&gt;', { "class": 'lb-data' }).append($('&lt;div/&gt;', { "class": 'lb-details' }).append($('&lt;span/&gt;', { "class": 'lb-caption' }), $('&lt;span/&gt;', { "class": 'lb-number' })), $('&lt;div/&gt;', { "class": 'lb-closeContainer' }).append($('&lt;a/&gt;', { "class": 'lb-close' }).append($('&lt;img/&gt;', { src: this.options.fileCloseImage }))))))).appendTo($('body')); $('#lightboxOverlay').hide().on('click', function(e) { _this.end(); return false; }); $lightbox = $('#lightbox'); $lightbox.hide().on('click', function(e) { if ($(e.target).attr('id') === 'lightbox') _this.end(); return false; }); $lightbox.find('.lb-outerContainer').on('click', function(e) { if ($(e.target).attr('id') === 'lightbox') _this.end(); return false; }); $lightbox.find('.lb-prev').on('click', function(e) { _this.changeImage(_this.currentImageIndex - 1); return false; }); $lightbox.find('.lb-next').on('click', function(e) { _this.changeImage(_this.currentImageIndex + 1); return false; }); $lightbox.find('.lb-loader, .lb-close').on('click', function(e) { _this.end(); return false; }); }; </code></pre> <p>My question is, can I insert the form in HTML? I guess I can.<br> But can I use PHP include maybe to insert functions for the random image etc?</p> <p>What will you use to achieve something like that? Do you know an example I can use as reference? I have really read documentation and a lot of stuff for the main stuff like Colorbox and Lightbox, also it has to be compatible with Jquery.</p> <p>EDIT : WOOOOW!! : Look what i found under jquerytools. <a href="http://jquerytools.org/demos/combine/html5-form/index.html" rel="nofollow">http://jquerytools.org/demos/combine/html5-form/index.html</a></p> <p>If this is compatible on internet explorer 6 and beyond, I have a winner.</p> </div>

Lightbox在PHP中不起作用,而是正常加载

<div class="post-text" itemprop="text"> <p>I' trying to create a lightbox where when you click on <em>Login</em>, a lightbox will popup. Here is my code.</p> <pre><code>&lt;?php if(!isset($_SESSION['username'])) { echo '&lt;a onclick="javascript:displaylightbox({width:500,height:660,centerOnScroll:true,overlayOpacity:0.6})" href="./database/login.php" target="_self"&gt;Login&lt;/a&gt;'; }?&gt; </code></pre> <p>The link works, but the lightbox doesn't popup. Link load like normal instead.</p> <p>Here is the function</p> <pre><code>&lt;script&gt;function displaylightbox(url, options) { options.padding = 0; options.autoScale = true; options.href = url; options.type = 'iframe'; $.fancybox(options); } &lt;/script&gt; </code></pre> <p>Please help. Thank you!</p> </div>

在Lightbox中添加按钮 - Wordpress

<div class="post-text" itemprop="text"> <p>I want to add button into Auto ThickBox Plus(plugin like lightbox). So when I open some image I want that button there.<br> If you knew better lightbox with that button(which I want), I would really appreciate it. </p> <p>Thanks</p> <p>P.S.: I am the beginner in coding Wordpress' plugins </p> </div>

如何在提交表单条件后使用lightbox从SQL Server显示PHP查询结果

<div class="post-text" itemprop="text"> <p>So I'm redesigning the intranet for the library of a county-based historical society, and they have ridiculous amounts of data. Since the tables returning the data are so huge, every method I've tried to use so far breaks the layout and looks ugly. I'm hoping that some kind of lightbox feature could help display tabular data results.</p> <p>Basically I want this form:</p> <pre><code>&lt;form action="proc_church.php" method=post name=query&gt; &lt;br&gt; &lt;span style="color: #fff;"&gt;Input a &lt;b&gt;surname &lt;/b&gt;&amp;nbsp;&lt;/span&gt; &lt;select name="sname"&gt; &lt;option selected value="Last_Name"&gt;Last Name&lt;/option&gt; &lt;option value="Maiden_Name"&gt;Maiden Name&lt;/option&gt; &lt;/select&gt; &amp;nbsp; &lt;input type=text name=surname size=30&gt; &lt;br&gt; &lt;br&gt; &lt;span style="color: #fff;"&gt;Input a first name&amp;nbsp;&lt;/span&gt; &lt;input type=text name=firstname size=30&gt; &lt;br&gt; &lt;br&gt; &lt;span style="color: #fff;"&gt;Sort By&amp;nbsp;&lt;/span&gt; &lt;select name=pick&gt; &lt;option value="First_Name"&gt;First Name&lt;/option&gt; &lt;option value="Last_Name, First_Name"&gt;Last Name, then first name&lt;/option&gt; &lt;option value="[Church References].Church_Reference"&gt;Church&lt;/option&gt; &lt;option value="Page"&gt;Page&lt;/option&gt; &lt;option value="Exact_or_Range_Start_Date"&gt;Start Date&lt;/option&gt; &lt;option value="Range_End_Date"&gt;End Date&lt;/option&gt; &lt;/select&gt; &lt;input type=hidden name=orders&gt; &lt;input type=button value="Submit Query" onClick="process()" id=sub&gt; &lt;/form&gt; </code></pre> <p>to splash to a lightbox pop-up of the <code>proc_church.php</code> page seen in the code.</p> <p>If anyone could tell me which lightbox plugin would do this easiest (and how to execute it) or if it's even possible I'd really appreciate it. If it's not possible I'd love a few suggestions on how to accomplish it, like maybe a js pop-up window. Thanks.</p> </div>

当我试图访问lightbox iframe中的谷歌地图我得到不安全的JavaScript尝试访问带URL的帧

<div class="post-text" itemprop="text"> <p>when i 'm trying to access google map in lightbox iframe i'm getting Unsafe JavaScript attempt to access frame with URL Domains, protocols and ports must match.<br><br> my code is <br></p> <pre><code>&lt;a href="#inline_demo86871" rel="prettyPhoto[inline]" onclick="response_map(86871)"&gt;&lt;strong&gt;Map It&lt;/strong&gt;&lt;/a&gt; </code></pre> <p>Here i'm using pretty photo for popup lightbox depends on response_map id it loads the google map on popup.<br> everythng is working fine but. i'm getting the error when i'm trying to load map by clicking the anchor tag.<br></p> <pre><code>Unsafe JavaScript attempt to access frame with URL http://mysite.com from frame with URL http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=address&amp;output=embed. Domains, protocols and ports must match. </code></pre> </div>

在onload页面上打开Lightbox

<div class="post-text" itemprop="text"> <p>I would like to auto-open Lightbox when I open page. This is a edited page to wordpress plug-in -&gt; career portfolio. is it possible? Thanks</p> <p>I have created a link from image in the page to iframe Lightbox to portfolio. Good solutions is to see gallery directly opened whiteout click.</p> <p>Thank you for your time</p> <pre><code>&lt;script&gt; (function($) { jQuery('#gallery').crpTiledLayer({}); $( ".crp-light-gallery" ).each(function() { var id = $( this ).attr("id"); $("#" + id).lightGallery({ mode: 'slide', useCSS: true, cssEasing: 'ease', //'cubic-bezier(0.25, 0, 0.25, 1)',// easing: 'linear', //'for jquery animation',// speed: 600, addClass: '', closable: true, loop: true, auto: false, pause: 6000, escKey: true, controls: true, hideControlOnEnd: false, preload: 1, //number of preload slides. will exicute only after the current slide is fully loaded. ex:// you clicked on 4th image and if preload = 1 then 3rd slide and 5th slide will be loaded in the background after the 4th slide is fully loaded.. if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ... showAfterLoad: true, selector: null, index: false, lang: { allPhotos: 'All photos' }, counter: false, exThumbImage: false, thumbnail: true, showThumbByDefault:false, animateThumb: true, currentPagerPosition: 'middle', thumbWidth: 150, thumbMargin: 10, mobileSrc: false, mobileSrcMaxWidth: 640, swipeThreshold: 50, enableTouch: true, enableDrag: true, vimeoColor: 'CCCCCC', youtubePlayerParams: false, // See: https://developers.google.com/youtube/player_parameters, videoAutoplay: true, videoMaxWidth: '855px', dynamic: false, dynamicEl: [], // Callbacks el = current plugin onOpen : function(el) {}, // Executes immediately after the gallery is loaded. onSlideBefore : function(el) {}, // Executes immediately before each transition. onSlideAfter : function(el) {}, // Executes immediately after each transition. onSlideNext : function(el) {}, // Executes immediately before each "Next" transition. onSlidePrev : function(el) {}, // Executes immediately before each "Prev" transition. onBeforeClose : function(el) {}, // Executes immediately before the start of the close process. onCloseAfter : function(el) {}, // Executes immediately once lightGallery is closed. onOpenExternal : function(el) { var href = $(el).attr("data-url"); crp_loadHref(href,true); }, // Executes immediately before each "open external" transition. onToggleInfo : function(el) { var $info = $(".lg-info"); if($info.css("opacity") == 1){ $info.fadeTo("slow",0); }else{ $info.fadeTo("slow",1); } } // Executes immediately before each "toggle info" transition. }); }); jQuery(".tile").on('click', function (event){ event.preventDefault(); if(jQuery(event.target).hasClass("fa") &amp;&amp; !jQuery(event.target).hasClass("zoom")) return; var tileId = jQuery(this).attr("id"); var target = jQuery("#" + tileId + " .crp-light-gallery li:first"); target.trigger( "click" ); }); })( jQuery ); </code></pre> <p></p> <pre><code>&lt;div class="crp-wrapper"&gt; &lt;div id="gallery"&gt; &lt;div id="ftg-items" class="ftg-items"&gt; &lt;?php foreach($crp_portfolio-&gt;projects as $crp_project): ?&gt; &lt;div id="crp-tile-&lt;?php echo $crp_project-&gt;id?&gt;" class="tile"&gt; &lt;?php $coverInfo = CRPHelper::decode2Str($crp_project-&gt;cover); $coverInfo = CRPHelper::decode2Obj($coverInfo); $meta = CRPHelper::getAttachementMeta($coverInfo-&gt;id, $crp_portfolio-&gt;options[CRPOption::kThumbnailQuality]); ?&gt; &lt;a id="&lt;?php echo $crp_project-&gt;id ?&gt;" class="tile-inner"&gt; &lt;img class="crp-item" src="&lt;?php echo $meta['src'] ?&gt;" data-width="&lt;?php echo $meta['width']; ?&gt;" data-height="&lt;?php echo $meta['height']; ?&gt;" /&gt; &lt;div class="caption"&gt;&lt;/div&gt; &lt;/a&gt; &lt;ul id="crp-light-gallery-&lt;?php echo $crp_project-&gt;id; ?&gt;" class="crp-light-gallery" style="display: none;" data-sub-html="&lt;?php echo crp_infoBox( $crp_project)?&gt;" data-url="&lt;?php echo isset($crp_project-&gt;url) ? $crp_project-&gt;url : ''; ?&gt;"&gt; &lt;?php $meta = CRPHelper::getAttachementMeta($coverInfo-&gt;id); $metaThumb = CRPHelper::getAttachementMeta($coverInfo-&gt;id, "medium"); ?&gt; &lt;li data-src="&lt;?php echo $meta['src']; ?&gt;" &gt; &lt;a href="#"&gt; &lt;img src="&lt;?php echo $metaThumb['src']; ?&gt;" /&gt; &lt;/a&gt; &lt;/li&gt; &lt;?php foreach($crp_project-&gt;pics as $pic): ?&gt; &lt;?php if(!empty($pic)): ?&gt; &lt;?php $picInfo = CRPHelper::decode2Str($pic); $picInfo = CRPHelper::decode2Obj($picInfo); $meta = CRPHelper::getAttachementMeta($picInfo-&gt;id); $metaThumb = CRPHelper::getAttachementMeta($picInfo-&gt;id, "medium"); ?&gt; &lt;li data-src="&lt;?php echo $meta['src']; ?&gt;"&gt; &lt;a href="#"&gt; &lt;img src="&lt;?php echo $metaThumb['src']; ?&gt;" /&gt; &lt;/a&gt; &lt;/li&gt; &lt;?php endif; ?&gt; &lt;?php endforeach; ?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;?php endforeach; ?&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p></p> <p>I heve solved with this code in the end of js:</p> <pre><code> window.setTimeout('clickit()',20); function clickit(){ document.getElementById("&lt;?php echo $crp_project-&gt;id ?&gt;").click(); } </code></pre> </div>

使用javascript制作灯箱

<div class="post-text" itemprop="text"> <p>I have a lightbox that is the user login. When they submit a form it checks if the user is logged in if not it needs to show the lightbox to let the user log in.</p> <p>How can i do this out of the javascript.</p> <p>This is the html code that makes the lightbox appear when the link is clicked.</p> <pre><code>&lt;a href="#" class="popup-login"&gt;Login&lt;/a&gt; </code></pre> <p>This is the javascipt i have so far, the else being when the user is not logged in. This is where i want the lightbox to show.</p> <pre><code>function islogin(){ if(is_user_logged_in()){ add_file_post(); }else{ } } </code></pre> <p>Open login/registration via modal</p> <p>UserPro has built-in support for modal or lightbox view which you can use to display any of its shortcode, just like standard shortcodes.</p> <p><em>How to display the login form via modal or lightbox?</em></p> <p>You need a menu item or a custom HTML link that has this class: <em>popup-login</em> That's it. An example should be:</p> <pre><code>&lt;a href="#" class="popup-login"&gt;Login&lt;/a&gt; </code></pre> </div>

Lightbox无法放大图片

<div class="post-text" itemprop="text"> <p>This week our product pages have been not working as intended. When clicking the product image thumbnail to enlarge, the lightbox window loads and just continues to load, never displaying the image. It was working before and I have no access to these scripts and files, since they are loaded through PHP that I have no access to. We are on BigCommerce's platform, but BC will not help me because we have customized our template. I have poured through the source code and cannot find what could be causing this issue. Any help is greatly appreciated.</p> <p>Link to a product page: <a href="http://www.inflatableboats.net/demo-zodiac-pro-open-650-t-top-neo-2016-with-twin-yamaha-f70-four-stroke/" rel="nofollow">http://www.inflatableboats.net/demo-zodiac-pro-open-650-t-top-neo-2016-with-twin-yamaha-f70-four-stroke/</a></p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/"&gt; %%Panel.HTMLHead%% &lt;body&gt; &lt;script type="text/javascript" src="%%GLOBAL_AppPath%%/javascript/jquery/plugins/validate/jquery.validate.js?%%GLOBAL_JSCacheToken%%"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="%%GLOBAL_AppPath%%/javascript/product.functions.js?%%GLOBAL_JSCacheToken%%"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="%%GLOBAL_AppPath%%/javascript/product.js?%%GLOBAL_JSCacheToken%%"&gt;&lt;/script&gt; &lt;div id="Container"&gt; %%Panel.Header%% &lt;div id="Wrapper"&gt; %%Panel.WrapperBanner%% &lt;div class="Left" id="LayoutColumn1"&gt; %%Panel.SideCategoryList%% %%Panel.SideNewProducts%% %%Panel.SideNewsletterBox%% %%Panel.SideLiveChatServices%% &lt;/div&gt; &lt;div class="Content" id="LayoutColumn2"&gt; %%Panel.ProductBreadcrumb%% %%Panel.ProductDetails%% &lt;div id="Fees"&gt; &lt;p id="FeeHeader"&gt;&lt;strong&gt;Standard Fees Apply&lt;/strong&gt;&lt;/p&gt; &lt;a class="tooltip" style="float: left;" href="#"&gt; PDI: &lt;span&gt; &lt;img class="callout" src="http://inflatableboats.net/template/feebox/callout.gif" alt="" /&gt; &lt;strong&gt;Pre-Delivery Inspection&lt;/strong&gt;&lt;br /&gt; Standard Fee for services performed and products used on each new vessel, requested by all manufacturers to validate and assist in all warranties.&lt;br /&gt;&lt;br /&gt;We install a deep cycle marine battery, fully rig steering components, complete electrical and systems check. We conduct a full system check on the motor, fill with oil, fluids, and fuel, then test run in a test tank.&lt;br /&gt;&lt;br /&gt;Once everything is tuned and prepared, a sea trial is performed with two Specialists to achieve ideal RPM-to-top-speed ratio, ensuring the boat gets on plane properly, and all systems operate on water.&lt;br /&gt;&lt;br /&gt;Afterwards a full detail is performed on the tubes, deck, and hull to be turn-key ready for the customer. &lt;/span&gt; &lt;/a&gt; &lt;p style="float: left;"&gt;&amp;nbsp;&lt;/p&gt; &lt;a class="tooltip" style="float: left;" href="#"&gt; Destination Fee: &lt;span&gt; &lt;img class="callout" src="http://inflatableboats.net/template/feebox/callout.gif" alt="" /&gt; &lt;strong&gt;Destination Fees are set by Zodiac.&lt;/strong&gt;&lt;br /&gt; Standard Fee both vehicle and vessel dealerships are charged from a manufacturer to ship product to dealerships &lt;/span&gt; &lt;/a&gt; &lt;p style="float: left;"&gt;&amp;nbsp;&lt;/p&gt; &lt;/div&gt; &lt;div id="quote"&gt; &lt;a class="btn lightbox-40737220632144" style="cursor: pointer;"&gt;&lt;img id="quotebutton" style="" src="http://inflatableboats.net/template/img/request-a-quote.png" name="quotebutton" /&gt;&lt;/a&gt; &lt;a href="/financing/"&gt;&lt;img id="financebutton" style="" src="http://inflatableboats.net/template/img/finance-button.png" name="quotebutton" /&gt;&lt;/a&gt; &lt;/div&gt; %%Panel.ProductTabs%% %%Panel.ProductDescription%% %%Panel.ProductVideos%% %%Panel.ProductWarranty%% %%Panel.ProductOtherDetails%% %%Panel.SimilarProductsByTag%% %%Panel.ProductByCategory%% %%Panel.ProductVendorsOtherProducts%% %%Panel.SimilarProductsByCustomerViews%% &lt;/div&gt; &lt;div class="Right" id="LayoutColumn3"&gt; %%Panel.SideCurrencySelector%% %%Panel.SideProductAddToWishList%% %%Panel.SideProductRelated%% %%Panel.SideProductRecentlyViewed%% &lt;/div&gt; &lt;br class="Clear" /&gt; &lt;/div&gt; %%Panel.Footer%% &lt;/div&gt; &lt;script&gt; $(document).ready(function(){ $("#ProductOtherDetails .ProductDetailsGrid .DetailRow").each(function(){ var label = $(".Label",this).text(); if ( label === 'PDI:') { var pdiAmount = $(".Value",this).text(); pdiAmount = pdiAmount.replace(/\t/g,""); pdiAmount = pdiAmount.replace(/ /g,""); //console.log("PDI is " + pdiAmount); $("#Fees p:nth-of-type(2)").text(pdiAmount); } if ( label === 'DF:') { var dfiAmount = $(".Value",this).text(); dfiAmount = dfiAmount.replace(/\t/g,""); dfiAmount = dfiAmount.replace(/ /g,""); //console.log("DF is " + dfiAmount); $("#Fees p:nth-of-type(3)").text(dfiAmount); } }) }); &lt;/script&gt; &lt;script src="https://form.jotform.com/static/feedback2.js?3.3.REV" type="text/javascript"&gt; var JFL_40737220632144 = new JotformFeedback({ formId: '40737220632144', base: 'https://form.jotform.com/', windowTitle: 'Request a Quote', background: '#B10D13', fontColor: '#FFFFFF', type: 'false', height: 500, width: 700, openOnLoad: false }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I think that maybe it is caused by a TypeError, but do not know how I can fix this. Image linked below. It points me to the first line of the source, which is the HTML Doctype. That doesn't make sense to me. </p> <p><img src="https://i.stack.imgur.com/Xrf3M.png" alt="Link to Image showing Error"></p> </div>

jQuery.lightbox:youtube视频?

<div class="post-text" itemprop="text"> <p>I'm able to apply a JQuery.lightbox to an image but how do I apply it to a youtube video?</p> <pre><code>&lt;script src="jquery.lightbox.min.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; ... foreach ($xml-&gt;entry as $entry) : $kids = $entry-&gt;children('http://search.yahoo.com/mrss/'); $attributes = $kids-&gt;group-&gt;content[0]-&gt;attributes(); $flv = $attributes['url']; $attributes = $kids-&gt;group-&gt;player-&gt;attributes(); $link = $attributes['url']; ?&gt; &lt;a rel="lightbox" href="&lt;?=$link?&gt;" title="youtube video title"&gt; &lt;img src="http://i4.ytimg.com/vi/&lt;?=$id?&gt;/default.jpg" /&gt; &lt;/a&gt; &lt;?php endforeach; ?&gt; </code></pre> </div>

在AJAX中使用pdf.js

<div class="post-text" itemprop="text"> <p>I run a phpBB board, where I'd like to incorporate pdf.js for pdf presentation (so I can include it in a lightbox; but, I digress). Attachments in phpBB are retrieved using a id, invoking file.php.</p> <p>Here's a webpage where I present three thumbnails for a pdf: <a href="http://59plymouth.net/lightbox/pdfjs2.html" rel="nofollow noreferrer">http://59plymouth.net/lightbox/pdfjs2.html</a></p> <p>If you click on the first thumbnail, it presents a pdf using pdf.js, but without invoking file.php.</p> <p>If you click on the second thumbnail, it presents a pdf by invoking file.php, but using the native pdf app for presentation (i.e., w/o pdf.js).</p> <p>If you click on the third thumbnail, it attempts to present the pdf with a combination of file.php and pdf.js: ...href="./pdfjs/web/viewer.html?file=./download/file.php?id=16187</p> <p>But of course, the second "?" that invokes file.php is treated literally as data, and not as a query. I've surmised enough to know that I have to use AJAX to accomplish what I want to do, but I don't know how to do it. Can someone point me in the right direction?</p> </div>

在Lightbox / Modal中加载PHP成功消息

<div class="post-text" itemprop="text"> <p>I have a basic understanding of PHP, and in the past, have always loaded my "thank you for submitting/success message" info in an exterior php/html file. </p> <p>Currently I'm using Zurb.Foundation to build a site and was wondering how I can load a success message inside a modal I'm already using on the page?</p> <p>It's not currently active, but here's an example to reference (click 'submit' to see modal): <a href="http://www.josephsjoblom.com/clients/nhcw/contact.html" rel="nofollow">http://www.josephsjoblom.com/clients/nhcw/contact.html</a></p> <p>This is what I've typically done in my php file when all is good with the form:</p> <pre><code>/* Redirect visitor to the thank you page */ header('Location: ../thanks.html'); exit(); </code></pre> <p>Can I just use something like this?:</p> <pre><code>header('Location: #link_to_an_ID_example'); exit(); </code></pre> <p>Does anyone know how to do something like this or have an example link?</p> <p>Thanks</p> </div>

如何将lightbox jquery效果应用于从数据库中检索到的图像

<div class="post-text" itemprop="text"> <p>Hello pal's i need some help. I wanted to apply lightbox jquery effect on image gallery php file. I'm retrieving images from database which were stored in longblob format. i can get that effect by giving id value manually but by giving the variable like $id it's not providing that lightbox effect.... please check the below code and give some suggestions.</p> <pre><code>&lt;div id="gallery"&gt; &lt;?php $query = mysql_query("SELECT * FROM image_uploads") or die(mysql_error()); while($row = mysql_fetch_array($query)){ $id = $row['entry_id']; ?&gt; &lt;ul&gt; &lt;li&gt; &lt;a href="img_retrieve.php?oid=$id" $('#gallery').lightBox();"&gt; &lt;img src="img_retrieve.php?sid=$id" width="72" height="72" alt="" /&gt; &lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;?php } ?&gt; &lt;/div&gt; </code></pre> <p>in retrieve page follows</p> <pre><code>if(isset($_GET['sid'])){ $id = $_GET['sid']; $run = mysql_query("SELECT * FROM image_uploads WHERE entry_id=$id") or die(mysql_error()); while( $images = mysql_fetch_array($run) ){ $image = $images['s_image']; header("Content-type: image/jpeg"); echo $image; } } if(isset($_GET['oid'])){ $id = $_GET['oid']; $run = mysql_query("SELECT * FROM upload_images WHERE entry_id=$id") or die(mysql_error()); while( $images = mysql_fetch_array($run) ) $s_image = $images['s_image']; header("Content-type: image/jpeg"); echo $s_image; } } </code></pre> </div>

如何获得灯箱图片的标题

<div class="post-text" itemprop="text"> <p>I am using a php lightbox (this one - <a href="http://www.fatbellyman.com/webstuff/lightbox_gallery/index.php" rel="nofollow">http://www.fatbellyman.com/webstuff/lightbox_gallery/index.php</a>) to automatically display thumbnails and images. I would like to have the titles and image descriptions display on the larger lightbox images, pulled from a separate list (text file?). If it is possible to do this without using a database that would be best.</p> <p>This is on my gallery page:</p> <pre><code>&lt;?php include 'lightbox_display_function.php'; ?&gt; &lt;?php lightbox_display('apparel/soiled/icarus/', 'lightbox[icarus]'); ?&gt; </code></pre> <p>And this is the lightbox_display_function.php:</p> <pre><code>&lt;?php function lightbox_display($dir_to_search, $rel){ $image_dir = $dir_to_search; $dir_to_search = scandir($dir_to_search); $image_exts = array('gif', 'jpg', 'jpeg', 'png'); $excluded_filename = '_t'; foreach ($dir_to_search as $image_file){ $dot = strrpos($image_file, '.'); $filename = substr($image_file, 0, $dot); $filetype = substr($image_file, $dot+1); $thumbnail_file = strrpos($filename, $excluded_filename); if ((!$thumbnail_file) and array_search($filetype, $image_exts) !== false){ echo "&lt;a href='".$image_dir.$image_file."' rel='".$rel."'&gt; &lt;img src='".$image_dir.$filename."_t.".$filetype."' alt='".$filename."' width='70' height='70' title='$filename'/&gt; &lt;/a&gt;"." "; } } } </code></pre> </div>

Wordpress - 用lightbox替换attachment.php

<div class="post-text" itemprop="text"> <p>For each single post page on my WP, I have a large images that, when clicked, link to an attachment.php page where you can click through to view all images in the gallery (by clicking next).</p> <p>What I need is, when an image is clicked in a post, for a lightbox gallery to pop up where one can click through and view all the images in the gallery.</p> <p>I do not want a gallery style layout in my posts (thumbnail grid), because I have text and links interspersed throughout each post. </p> </div>

在php函数中检测wordpress短代码中的参数名称?

<div class="post-text" itemprop="text"> <p>I am trying yo understand this function, as a preface to forking it to make similar functions for my own shortcodes. I understand how to define shortcodes and their functions. I also basically "get" what the original author is doing here: collecting parameters from the shortcode and assembling them into an HTML tag and returning that tag. It seems the order of the params is unimportant, but their names are.</p> <p>However, when I am working with this code, it does not seem to understand which param is which. For example, the original docs say to use the shortcode like so: <code>[button link="http://google.com" color="black" size="small"]Button Text[/button]</code></p> <p>But when I use this shortcode, I get:</p> <pre><code>&lt;a href="Button Text" title="Array" class="button button-small button " target="_self"&gt; &lt;span&gt;Array&lt;/span&gt; &lt;/a&gt; </code></pre> <p>Here's my PHP:</p> <pre><code>if( ! function_exists( 'make_button' ) ) { function make_button( $text, $url, $color = 'default', $target = '_self', $size = 'small', $classes = null, $title = null ) { if( $target == 'lightbox' ) { $lightbox = ' rel="lightbox"'; $target = null; } else { $lightbox = null; $target = ' target="'.$target.'"'; } if( ! $title ) $title = $text; $output = '&lt;a href="'.$url.'" title="'.$title.'" class="button button-'.$size.' '.$color.' '.$classes.'"'.$target.$lightbox.'&gt;'; $output .= '&lt;span&gt;'.$text.'&lt;/span&gt;'; $output .= '&lt;/a&gt;'; return $output; } } add_shortcode( 'button', 'make_button' ); </code></pre> </div>

lightbox弹出框上如何再弹出确认框

最近项目中用lightbox做了一个弹出页面,然后在该页面上进行操作时需要再弹出个确认框, 但是这个确认框总是被原弹出页面遮盖, 请问这种情况该如何解决? 如何做成像alert()方法一样总是置于最上层

在主页但不在内部目录中工作的代码 - 只显示加载

<div class="post-text" itemprop="text"> <p>my code works fine in home directory but in inner directory it keep on showing loading image.never shows original page</p> <p>here is my simple code</p> <pre><code> &lt;html&gt;&lt;head&gt;&lt;style type="text/css" media="all"&gt;@import "http://static.something.com/files/common_css/style16.css";&lt;/style&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://static.something.com/js/lightbox/js/jquery.lightbox-0.5.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://something.com/js/jquery.form33.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt;jQuery(document).ready(function($) {$('a[rel*=facebox]').facebox()}) &lt;/script&gt; &lt;/head&gt;&lt;body&gt; &lt;?php echo' &lt;body style="cursor:auto" id="curpo" onLoad="$.image({ ajax: \'http://something.com/jquery/desigirls/77987\' });return false;" class="uiMediaThumb uiMediaThumbLarge uiMediaThumbAlb uiMediaThumbAlbLarge"&gt;&lt;/body&gt; '; ?&gt;&lt;/body&gt;&lt;/html&gt; </code></pre> <p>this code works fine here <a href="http://something.com/testage.php" rel="nofollow noreferrer">http://something.com/testage.php</a></p> <p>but not works in this page <a href="http://www.something.com/touch/w2et/testage.php" rel="nofollow noreferrer">http://www.something.com/touch/w2et/testage.php</a></p> <p>everything is same.i think there is some issue with javascript or image references.i tried changing all but same problem.</p> <p>here is jsbin link as well jsbin.com/royepawomi/edit</p> <p>here also it is not working</p> </div>

Lightbox超越浏览器

<div class="post-text" itemprop="text"> <p>I'm working on a new project, a web application, where I need to focus the user on a particular task. Therefore I want to eliminate all other "System Generated Noise", like Browser Menus, Buttons, Address Bar, OS Task Bar and so forth. I have seen implementations like Lightbox, but this modal approach is limited to the size of the browser window.</p> <p>What I want to do is have the same effect but stretched out beyond de browser so it covers the WHOLE screen. Well, at least that is the effect I'm aiming for.</p> <p>The application is already on its way, it is being developed with PHP5, XHTML and Javascript/AJAX.</p> <p>Please, if someone can point me in the right direction I'd greatly appreciate it.</p> </div>

我的JavaScript文件未在WordPress中加载

<div class="post-text" itemprop="text"> <p>I am trying to run a lightbox plugin in WordPress. For some reason it will not load and I have the correct file path. Normally I use the cdn version of files, but there is not a such version around and I have to load it locally. I also have some violations. I have no idea what is going on and why I am receiving the error. </p> <p>functions.php</p> <pre><code>function nutrition_club_theme_script_enqueue() { wp_enqueue_script('jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'); wp_enqueue_script('jquery-tools', get_template_directory_uri() .'/js/jquery.tools.min.js', array('jquery'), '', true); wp_enqueue_script('jquery-portfoliolightbox', get_template_directory_uri() .'/js/jquery.portfoliolightbox.js', '', '', true); wp_enqueue_script('jquery-magnific-popup', 'https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js'); wp_enqueue_script('customjs', get_template_directory_uri() . '/js/nutrition_club_theme.js', array('jquery'), '4.8', false); wp_enqueue_script('owljs', 'https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.carousel.min.js'); wp_enqueue_script('bootstrapjs', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '3.3.7', true); wp_enqueue_script('popup-galleryjs', get_template_directory_uri() . '/js/popup-gallery.js', array(), '', true); wp_enqueue_script('wowjs', 'https://cdnjs.cloudflare.com/ajax/libs/wow/1.1.2/wow.min.js'); } add_action(wp_enqueue_scripts, 'nutrition_club_theme_script_enqueue'); </code></pre> <p>custom.js</p> <pre><code> jQuery(".service-popup").lightBox({ imgpath: 'https://unsplash.it/1200/900?image=839', title: 'Your Title', text: 'Enter any text', link: ['http://www.link1.com', 'http://www.link2.com'], linkText: ['Site 1 Text', 'Link 2 text'] }); </code></pre> <p>Chrome error</p> <pre><code>Uncaught TypeError: jquery-3.2.1.min.js?ver=3.2.1:2 jQuery(...).lightBox is not a function at HTMLDocument.&lt;anonymous&gt; (nutrition_club_theme.js?ver=4.8:81) at j (jquery-3.2.1.min.js?ver=3.2.1:2) at k (jquery-3.2.1.min.js?ver=3.2.1:2) (anonymous) @ nutrition_club_theme.js?ver=4.8:81 j @ jquery-3.2.1.min.js?ver=3.2.1:2 k @ jquery-3.2.1.min.js?ver=3.2.1:2 </code></pre> <p>Violations</p> <pre><code>[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. jquery-3.2.1.min.js?ver=3.2.1:2 [Violation] 'setTimeout' handler took 341ms [Violation] Forced reflow while executing JavaScript took 197ms [Violation] Forced reflow while executing JavaScript took 65ms </code></pre> </div>

css块中加了onclick事件,怎么让块中的一个图片链接不执行onclick?

css块中加了onclick事件,我想让这个块中的一个图片链接不受影响,该图片被点击后会执行一个lightbox效果,这个效果需要有,也就是说点击这个图片会触发lightbox效果但不会执行onclick,请问怎么弄?

2019 Python开发者日-培训

2019 Python开发者日-培训

150讲轻松搞定Python网络爬虫

150讲轻松搞定Python网络爬虫

设计模式(JAVA语言实现)--20种设计模式附带源码

设计模式(JAVA语言实现)--20种设计模式附带源码

YOLOv3目标检测实战:训练自己的数据集

YOLOv3目标检测实战:训练自己的数据集

java后台+微信小程序 实现完整的点餐系统

java后台+微信小程序 实现完整的点餐系统

三个项目玩转深度学习(附1G源码)

三个项目玩转深度学习(附1G源码)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

2019 AI开发者大会

2019 AI开发者大会

玩转Linux:常用命令实例指南

玩转Linux:常用命令实例指南

一学即懂的计算机视觉(第一季)

一学即懂的计算机视觉(第一季)

4小时玩转微信小程序——基础入门与微信支付实战

4小时玩转微信小程序——基础入门与微信支付实战

Git 实用技巧

Git 实用技巧

Python数据清洗实战入门

Python数据清洗实战入门

使用TensorFlow+keras快速构建图像分类模型

使用TensorFlow+keras快速构建图像分类模型

实用主义学Python(小白也容易上手的Python实用案例)

实用主义学Python(小白也容易上手的Python实用案例)

程序员的算法通关课:知己知彼(第一季)

程序员的算法通关课:知己知彼(第一季)

MySQL数据库从入门到实战应用

MySQL数据库从入门到实战应用

机器学习初学者必会的案例精讲

机器学习初学者必会的案例精讲

手把手实现Java图书管理系统(附源码)

手把手实现Java图书管理系统(附源码)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

.net core快速开发框架

.net core快速开发框架

玩转Python-Python3基础入门

玩转Python-Python3基础入门

Python数据挖掘简易入门

Python数据挖掘简易入门

微信公众平台开发入门

微信公众平台开发入门

程序员的兼职技能课

程序员的兼职技能课

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

HoloLens2开发入门教程

HoloLens2开发入门教程

微信小程序开发实战

微信小程序开发实战

Java8零基础入门视频教程

Java8零基础入门视频教程

相关热词 c#跨线程停止timer c#批量写入sql数据库 c# 自动安装浏览器 c#语言基础考试题 c# 偏移量打印是什么 c# 绘制曲线图 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行
立即提问