Shadowbox not opening on hover until clicked once - javascript

I am using Shadowbox to display image on hover, but for some reason it works only AFTER I clicked the link for the first time. I am using Chrome and FireFox, neither working right.
You can see here: http://www.impero.co.za/demo/hsrc/site_content/view/how-we-curate-data
There is an anchor called "Qualitative Data". It does not open the Shadowbox on hover, but once I have clicked on it once, it opens, and from there onwards, it opens on hover.
As far as I can see from shadowbox's website, and Stackoverflow resources posts, I am doing this right.
Any idea what is wrong here?
Thanks in advance,
Kobus

Use Shadowbox.open(this); in your onmouseover attribute, e.g.
<a id="shadowbox[gallery]"
href="http://www.impero.co.za/demo/hsrc/assets/uploads/images/qualitativedata.jpg"
onmouseover="Shadowbox.open(this);"
rel="shadowbox[gallery]">Qualitative Data</a>

Related

Exclude images from lightbox in "Photo Swipe Masonry"

i am using the "Photo Swipe Masonry" plugin (version 1.0.6) on wordpress 4.3.1.
It works perfect so far.
But, i have some images which have a custom link to an external url(instead of the stadard to the image). If i click one of these images, it opens the url in a new window. That works like expected.
Now, when i click on an standard image(no external url), the lightbox opens and the image is displayed like expected.
But now, when i use the prev/next buttons to navigate through the images and i reach an image with a custom link, i got the errormessage:
"The image could not be loaded" (in the lightbox).
So, my question is, how to exclude images from being added to the lightbox?
Maybe by a unique class ?
Any help is highly appreciated.
Many thanks in advance to all of you for your time.
Regards,
Joe
I'm the developer of this plugin. Sorry for missing this post. There is no function built in for this sorry. You would need to edit the photoswipe code.

How to open a link in a new tab when clicking on an image in a chrome extension?

I made a simple Chrome Extension that, when clicked, has a dropdown menu that has a row of icons. Is it possible to set it so when the icon is clicked, it opens its respective website in a new tab?
(NOTE: I have tried to make it refer to a link in the popup.html file, but if I click on the icon, it doesn't do anything.)
Any help, suggestions or advice is greatly appreciated, thanks!
You need to assign a click handler to the icon that executes the following:
chrome.tabs.create({url: websiteToOpen});
If you want it to open in the background without closing the popup, one more parameter is required:
chrome.tabs.create({url: websiteToOpen, active: false});
Do note that "tabs" permission is not needed for this.
This example from Chrome docs shows how to properly assign a click hanlder in a way that's compatible with Chrome extensions (onclick attribute will not work)
#Xan
Hey, thanks for your answer and sorry for the late reply... I figured it out though, and I didn't need to add any click handlers... I just did:
<a target = "_blank" href = "http://google.com">
<img src = "http://upload.wikimedia.org/wikipedia/commons/a/a0/Google_favicon_2012.jpg"/>
</a>
the target attribute says to open it in a new tab and it does exactly that when I click on it. Problem solved! Thanks!

How to close a fancybox element in Google Chrome developer tools?

I would like to close a popup content in some web pages via Chrome developer console.
For example:
When I open http://www.cw.com.tw for the first time, it will show a fancybox-content element.
So I will have to click the "close button" of the advertisement in order to read to article.
This website is trustable, but for some websites, if I don't want to click that element for some security concerns, how can I close that popup content and remove the grey layer without click the fancybox-close button.
In another word, how can I know which function it triggers when I click that fancybox-close button?
I tried inspected the element, and deleted the fancybox-contentnode directly. But it didn't help very much.
Any help would be appreciated, thanks in advance.
You should have read the document first though,
$.fancybox.close()
should do the trick.
FYI, the API documentation here.
http://fancybox.net/api

Open a Link to another website from within Fancy Box in a new window

Im stumped..... I'm using Fancybox jquery plug in to display some iframes over the top of my page in a lightbox style.... i have it all working but if I try to link to an external website from within the lightbox using the normal somesite
I before you suggest it I have tried target="_blank"with no luck.
it opens in the lightbox not in the original window, I dont mind if it opens in a new tab or windows I just cant have it opening in the lightbox... has anyone else experienced this before?
Just to make sure that I have understood the scenario here -
You have a link that when clicked, opens the content in a fancybox pop-up.
This content has some text and within that, it has a somesite link. You have also tried target="_blank".
When this <a>..</a> is clicked, it should act like a normal link and open in a browser (new tab or window). But it opens the this link in the fancybox pop-up instead.
If that's the case then I tried it and the link opened in a new tab.
Please clarify the above doubt of mine.
Thanks.
Try target="_parent" instead of target="_blank"
See following example:
somesite

jquery click button on another site

I am trying to make a Google Chrome app that automatically opens a YouTube site and clicks on the expand button, or any button.
I tried to use the following JavaScript:
$('#logo').click(); , .trigger('click');
But nothing happens.
Does anybody know how to do it?
Thanks
The thing you're clicking must be clickable. There is a link around the logo (id="logo-container") you need to click that, not the logo itself. Right click on the logo in chrome, select inspect element and then you'll see what the <a> tag is around the img.
Try this:
$('#logo-container').click();

Categories

Resources