99% of the way to getting a Lightbox caption link to work… - lightbox

...or that's how it feels at least :)
I know similar Lightbox link questions have been asked before but I'm not sure they applied exactly to my situation. I am trying to set it up so that a link in the Lightbox title/caption opens the full size image. In other words, on my page, I have a thumbnail, then if I click on that, it opens a detail (in Lightbox), then below that Lightbox popup would be some text, and a link to view an even larger image (ideally as a Lightbox popup.) I have read a bunch of other threads and followed the instructions to change the <> to html values, etc. and I think I'm nearly there, but it's not quite working. The link is showing up properly in my code, and I get a finger pointer when I hover over the link, but for some reason nothing happens when I click it. I can right click and open the link in new window, and that works, but apparently something (in the Lightbox code?) is preventing it from working on the page.
I guess what I'm wondering is:
Is this possible?
Is it relatively simple (I have no experience with Javascript/Jquery…)
Is it possible to have a link in a Lightbox popup open another Lightbox popup?
Is there an option other than Lightbox that will allow this (Colorbox? Slimbox?)
Here is my code so far:
<img src="<?php echo $image->url() ?>" width="<?php echo $image->width() ?>" height="<?php echo $image->height() ?>" alt="<?php echo $image->name() ?>" />
Here is an example of how it's outputting:
<div class="item" style="width: 194px; margin: 3%;">
<img src="http://www.chrissvensson.info/ces85/content/035-035/DSC_3335.jpg" width="194" height="300" alt="DSC_3335" /></div>
Just to clarify, I am using Lightbox 2.5.1 (http://lokeshdhakar.com/projects/lightbox2/)
Thanks so much for any help you might be able to provide. And again, I apologize if this has been answered before…

It's quite hard to tell exactly what you've got so far without you posting a little more of your code, but I can try to go through a couple of the very basics of what you need to do.
Firstly, most lightbox style plugins are based on jQuery, which means you're going to run some javascript code on the client side.
Your PHP will generate the static content which gets everything set up, then you need to run the jQuery plugin which will do lots of magic and convert it into a lightbox. As you didn't mention which plugin you're using I'll go with fancybox, as I think it has a lot of nice options: http://fancybox.net/howto. I won't go through all the boring set up details as they're already on the site, but here's the two most important bits:
you need to set up an image, encapsulated by a link, like the example given. Your PHP should dynamically generate this, similar to what you've done already.
<a id="image_id" href="image_big.jpg"><img src="image_small.jpg" alt=""/></a>
Before any javascript, it's just a thumbnail of the image (image_small.jpg) that links through to the full sized one (image_big.jpg)
Now to make this actually work, you need to point the javascript plugin at the link you just made.
I would advise you read through some basic jQuery documentation or tutorials like this one, as you'll find the library really useful, but long story short, to select an element by id in jquery, you would use this: $('#image_id').
All you need to do then, is run fancybox on this link when the plugin loads:
$('#image_id').fancybox();
The best place to put this is within jQuery's $(document.ready(function(){/*your code in here*/}) which is call when the page is loaded.
With fancybox, to add a caption/title when the window opens, you just need to add a caption="caption here" attribute into the <a> anchors that you create.
Regarding your question about a lightbox popup within a lightbox popup, it is entirely possible, but you'd have to do a little bit of extra javascript wizardry. My advice would be to consider the user experience and find an alternative (perhaps just allow the user to download the massive image, or look for plugins that allow you to zoom in to something), because opening two modal dialogues sounds quite confusing for the user!
Anyway, hope this helps.

Related

Using Html Anchor on my web site

I am using weebly site builder and so just a beginner on Html coding. I am having issues making anchors work on my pages. They seem to work on some systems and not others, and so I think there must be a better method.
Here is what I am doing
I have a guest author page and I want each guest, to have a direct link to his section of the web page
I set up an anchor as follows
Then use the following link to it
http://arthurvaso.weebly.com/guests2016.html/#smith2
On some computers/broswers this works just fine, in others, it just goes to the Top of the page instead of the section I want.
I basically have pages I want to make direct links to
Poet1
Poet2
Poet3 etc
I search here, an all the posts were either years old, or not exactly the answer I was looking for. It seems the newer the browser version, the less my method works.
I really appreciate any help, thanks!
There is a little trick to it, but it's an easy fix for you. You are missing in your Anchor.
Change:
<a id="smith2"></a>
To:
<a id="smith2"> </a>
Make sure to publish the changes.
And, note that your Anchor Link should be:
http://arthurvaso.weebly.com/guests2016.html#smith2
without the / after .html

wordpress plugin link in description opens in same window

I've decided to provide a tag to setup videos in my plugin description.
In doing this, I've found WordPress does not respect the target="_blank" option.
Does anyone know a method of doing this?
Although it should be obvious, here is my code:
this video playlist
It's so strange that in your WP not work target="_blank.
In the editor there is the command and give target="_blank.
So you can force it with:
<a onclick="openInNewTab('https://www.youtube.com/watch?v= video code ');">this video playlist</a>
This for me work every time.

How do I remove the hyperlink from a countdown iframe code I got from a countdown generator

I have made this countdown on this website:
http://www.timeanddate.com/clocks/freecountdown.html
They gave me the iframe link to put it on my website, it is perfect as can be, only thing that is high unprofessional is for it to hyperlink to their free generator, the code is iframe, i'm not an expert on that and from what I've read you can't convert it to html, but how do I go about this? This is the code for the countdown script I made:
<iframe src="http://free.timeanddate.com/countdown/i38wb1iy/n240/cf12/cm0/cu4/ct0/cs0/ca0/cr0/ss0/cac000/cpc000/pcfff/tcfff/fs100/szw320/szh135/tatTime%20left%20to%20Event%20in/tac000/tptTime%20since%20Event%20started%20in/tpc000/mac000/mpc000/iso2012-08-20T00:00:00" frameborder="0" width="175" height="66"></iframe>
The source of the iframe code links to this page:
http://free.timeanddate.com/countdown/i38wb1iy/n240/cf12/cm0/cu4/ct0/cs0/ca0/cr0/ss0/cac000/cpc000/pcfff/tcfff/fs100/szw320/szh135/tatTime%20left%20to%20Event%20in/tac000/tptTime%20since%20Event%20started%20in/tpc000/mac000/mpc000/iso2012-08-20T00:00:00
which shows the countdown, but I still can't seem to find a way to take away the hyperlink or use the code in my own way for that matter.
If anyone could help me out and tell me how to work with this iframe script or be able to create an exact same countdown, as it shouldn't be that hard(it looks pretty simple), it would be highly appreciated!
The idea of iframe is 'a webpage inside a webpage'. So if you use the iframe you actually embed the third-party code. Besides - trying to remove a link would probably violate their terms of use.
Creating your own countdown in javascript wouldn't be difficult and can be a good exercise for a novice coder. Please look at Date reference:
http://www.w3schools.com/js/js_obj_date.asp
Note, that if you substract two dates, you get miliseconds delta of these dates. Using the modulo and division operators you can convert it into years/months/days. Then use e.g. jQuery methods:
http://api.jquery.com/category/manipulation/
to perform substitution on your page.
It's very simple. Select the full iframe through dream Weaver and down you can add your index page link, so that if anyone clicks on the timer from your home page, it will not divert. You will remain in your home page.
add the following css
iframe{
pointer-events: none;
}
if this doesn't work then try adding class or id in iframe tag.

Image description as popup in asp.net

I am making an ASP.NET website where i have sort of a static image gallery. Now when i click on an image in this gallery i want to show a pop up containing text (10-15 lines) describing the image.
How can I achieve this? I don't have much idea as to how I should proceed.
There are two steps to archive this.
First step is to make the pop up window using css.
Many examples on google about that.
Search on google
Open Css popup
Easy Css pop up
The Second step is to make your javascript to open it and show your actually text. If you use a library like jQuery you can make many thinks more easy, but if you wish pure javascript can you also make it work.
For example on the last link 'Easy Css pop up', the javascript to open it is:
<a href="javascript:void(0);" onMouseover="ShowPop('pop');"
onMouseout="HidePop('pop');"><img src="myimage.jpg" alt=""></a>
So what you do is to render your text of your images into the div that have this css popup and then you place a code like that on every image to open the correct popup.
Of cource you can find a ready to use gallery like the http://highslide.com/
You can use jQueryUI Dialog or simply open page with javascript

cant find a way to show inline content from the same page using lightbox2

i am using the lightbox2 module in my drupal site.
i would like to be able to trigger the lightbox on content that lies withing the same page.
something like this:
<a rel="lightbox" href="#">Show content in light box</a>
<div id="content_to_show">the content i want to show in my light box</div>
cant figure out a way to do that.
any help ?
well after searching around, i have came to the conclusion that lightbox is not the proper plug in to use.
instead i am using the colorbox plugin at http://colorpowered.com/colorbox/ which has this capability integrated, and simple to use.

Resources