open images in a certain area in a popup window
2 posters
Page 1 of 1
open images in a certain area in a popup window
ok so i resized all images inside my #chatbox
so now what i wanna do is if someone clicks on the img it will open the image in a popup window so they can see it fullsize... and i only ant it to effect the images inside of the #chatbox element
yes i know more work for for you ange .. and ty for the script cause your probably only one on here who can do it
so now what i wanna do is if someone clicks on the img it will open the image in a popup window so they can see it fullsize... and i only ant it to effect the images inside of the #chatbox element
yes i know more work for for you ange .. and ty for the script cause your probably only one on here who can do it
Last edited by _Twisted_Mods_ on Mon 24 Nov 2014, 01:20; edited 1 time in total
Re: open images in a certain area in a popup window
Hello _twisted_mods_,
Something like this ?
Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In the homepage
Something like this ?
Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In the homepage
- Code:
$(function() {
var fa_chat = document.getElementById('frame_chatbox'), frame, overlay = document.createElement('DIV'), image = document.createElement('IMG');
if (!fa_chat) return;
overlay.onclick = function() { this.style.display = 'none' };
overlay.setAttribute('style','display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.4);z-index:100000;text-align:center;');
document.body.appendChild(overlay), overlay.appendChild(image);
fa_chat.onload = function() {
if (fa_chat.contentDocument) frame = fa_chat.contentDocument;
else if (fa_chat.contentWindow) frame = fa_chat.contentWindow.document;
// kill the interval if archives are enabled
var a = frame.getElementsByTagName('A');
for (i=0; i<a.length; i++) if (/archives/.test(a[i].href)) a[i].onclick = function() { window.clearInterval(_chat_refresh) };
// execute code in an interval
_chat_refresh = window.setInterval(function() {
var img = frame.getElementById('chatbox').getElementsByTagName('IMG'),i;
for (i=0; i<img.length; i++) {
img[i].onclick = function() {
overlay.style.display = 'block';
image.src = this.src;
}
}
},100);
}
});
Re: open images in a certain area in a popup window
work awesome but is there a way to prevent it from reloading the img each times it clicked and it minimized back to the chatbox
Re: open images in a certain area in a popup window
Could you explain what you mean ? From what I tried, the image was already loaded.
Re: open images in a certain area in a popup window
ok lets say i have a img in the chat box and i click it
when it pops up it reloads the image in the overlay like it was never open
then when i minimize it back to the chat box the img in the chatbox reloads like it was never open
if you dont understand me from there ill try to take screenshots or something
when it pops up it reloads the image in the overlay like it was never open
then when i minimize it back to the chat box the img in the chatbox reloads like it was never open
if you dont understand me from there ill try to take screenshots or something
Re: open images in a certain area in a popup window
That's weird, it doesn't do that for me.
Usually when you view an image, the data of that image is cached by its URL : https://2img.net/i/bl/logo.png So, wherever I view that image, it will be loaded already, unless I clear my cache.
Did you make any changes to how data is saved for your browser ?
Usually when you view an image, the data of that image is cached by its URL : https://2img.net/i/bl/logo.png So, wherever I view that image, it will be loaded already, unless I clear my cache.
Did you make any changes to how data is saved for your browser ?
Re: open images in a certain area in a popup window
no but i use my phones internet and it its tethered to my pc using virtual network and a proxy so maybe thats the issue
Re: open images in a certain area in a popup window
It must be, because I tested on IE, Chrome, and Firefox + Aurora. All reacted the same by caching the image.
Re: open images in a certain area in a popup window
ok then this is
solved
as always thankyou for you help once again
solved
as always thankyou for you help once again
Similar topics
» How do I add a button in the Reply Editor to open a popup window
» How to change the forum name when i open it in a new window
» Open music player in pop up window
» Forum images change to Font Awesome images
» Chatbox: Smile's window integrated into the chat window!
» How to change the forum name when i open it in a new window
» Open music player in pop up window
» Forum images change to Font Awesome images
» Chatbox: Smile's window integrated into the chat window!
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum