DustinCook
Member
Posted 6 years ago #
Hello.
I am using a piece of HTML in my blog, that will display a thumb nail of an image, then when it is clicked, a pop up window will open, and a bigger version of the picture will open in a new window.
I can't get this piece of coding to work right in word press, it will display a blank box, and when I click it, it loads a new window with that post entry in it.
Any ideas how to get aorund this little problem/
Thanks.
Dustin Cook.
It'd help if you posted the code because you can use normal HTML is posts already.
Hm, I'm not sure why that wouldn't work, unless you're using non-standard code. Try this:
<a href="/images/bigimage.jpg" target="_blank"><img src="/images/smallimage.jpg" alt="thumbnail" /></a>
DustinCook
Member
Posted 6 years ago #
Thaks. The images now work, but IO do have another problem.
I want the new window to open with the image inside it, and have the window resized so that it fits around the image.
Any ideas on how to do that?
Thanks.
Dustin.
macmanx: target="_blank" is depreciated, don't use it. ;)
"deprecated"?
[edit] Oh. Had to look that one up in the dictionary. lol [/edit]
macmanx: target="_blank" is depreciated, don't use it
Oops. It has been so long since I forced new windows on my readers that I have completely forgotten about that. There is a javascript tag to do the same thing, and it isn't deprecated, but I don't remember what it is either. Like I said, I no longer force new windows on my readers.
[Edit] I think this is the proper tag. Please correct me if I am wrong: onClick="javascript:popUp('/images/bigimage.jpg')"
external.js goes in the header and use rel="external" in the links.
I guess I shouldn't be surprised but "deprecate" is in Wikipedia.
Beel, I like that external.js file. Very smart and "future-safe" idea, but I haven't seen it in action on your site. From reading it, it looks like it opens all rel="external" links in a new window. Am I right?
DustinCook
Member
Posted 6 years ago #
OK, that new piece of code supplied is more like the code that would not work for me when I tried originally???
Should it work:
<img src="imagetitle" border="0" width="SET" height="SET" alt="Image Description">
Please post your code inside backticks. The backtick key is typically located to the left of the 1 key, above the tab key, and below the escape key.
DustinCook
Member
Posted 6 years ago #
<a href="#" onClick="popup = window.open('images/1x01x1.jpg', 'PopupPage', 'height=225, width=320, scrollbars=no, resizable=yes'); return false" target="_blank"><img src="images/1x01x1.jpg" border="0" width="140" height="105" alt="Chakotay"></a>
Try:
<a href="#" onClick="javascript:popUp('images/1x01x1.jpg', 'PopupPage', 'height=225', 'width=320', 'scrollbars=no', 'resizable=yes')"><img src="images/1x01x1.jpg" border="0" width="140" height="105" alt="Chakotay"></a>
DustinCook
Member
Posted 6 years ago #
Do I need to add anything to the template? If so, what should I add, where do I add it to and what page do I add it onto.
Thanks very much for the help.
Nope, just add that line to the post that you want to include the image thumbnail + full image popup in. Is it working?
DustinCook
Member
Posted 6 years ago #
The image is showing up, but when you click on it, it just takes you to the top of the page.
Sorry about that. Try this:
<a href="javascript:popUp('images/1x01x1.jpg', 'height=225', 'width=320', 'scrollbars=no', 'resizable=yes')"><img src="images/1x01x1.jpg" border="0" width="140" height="105" alt="Chakotay"></a>
DustinCook
Member
Posted 6 years ago #
Still no joy, do I need to add something into the header for the page?
No, you don't you have to add anything to the theme. Basically, HTML will work in your posts, I'm just not giving you the right code string. I have no experience with this javascript popup code, mostly because I hate popups, and I wish that someone with experience with this type of popup code would stop by to correct it.
DustinCook
Member
Posted 6 years ago #
That's ok, thanks a million for your helop anyway!
UlyssesParedes
Member
Posted 6 years ago #
I'n no expert in this but I came accross this topic while looking to solve the same problem on this site.
http://www.people.virginia.edu/~jfo/asee/popup.htm
I'll found a new plugin
Zappelfillip
I know it is in german language, but I'm shure if you can't understand it, Zappelfillip would like to translate.
kindly regards
Monika