We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Code For Clickable Images
Topic Started: Aug 5 2012, 10:56 AM (616 Views)
enias
Member
[ *  * ]
Board Address: (http://s4.zetaboards.com/tvaplus/topic/9666118/1/#new 'Private')
Board Software: (ZetaBoards )
Description: (

Wu have this code to make Clackable Images

Posted Image

what I'd like is a code that creates a botton in add replay to use it similar to Flash or Url Image.. a botton that asks you url and the link of the image... a faster way..
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
$('#c_bbcode button:last').after(' <button type="submit" onclick="URLImage(); return false">URL Image</button>');

function URLImage() {
var url = prompt('Insert URL:', '');
var image = prompt('Insert Image:', '');
ZetaInsert('[url=' + url + '][img]' + image + '[/img][/url]');
}
</script>
Offline Profile Goto Top
 
enias
Member
[ *  * ]
Thanks... the bad thing is that.. the botton asks me the URL page... then the Image URL but I cant change the page to copy the URL image
a way that the code asks you both url at the same time?
it wouldnt help... I cant copy boath links... the thing is that once the window comes up asking the url you cant change pages...
it wouldnt help... I cant copy boath links... the thing is that once the window comes up asking the url you cant change pages...
Edited by enias, Aug 6 2012, 07:34 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I could have the button open a new browser window to copy the URL's, would that be fine?
Offline Profile Goto Top
 
enias
Member
[ *  * ]
yep cory!!
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
$('#c_bbcode button:last').after(' <button type="submit" onclick="URLImage(); return false">URL Image</button>');

function URLImage() {
window.open(main_url);
var url = prompt('Insert URL:', '');
var image = prompt('Insert Image:', '');
ZetaInsert('[url=' + url + '][img]' + image + '[/img][/url]');
}
</script>
Try that instead.
Offline Profile Goto Top
 
enias
Member
[ *  * ]
I'rather stay with the old one, when I clicked a new window to mi board index is opnede... but cant still do nothing
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I tested it in Firefox and what it did was open a new tab and from that new tab I could copy a URL and paste it into the prompt input box. Is that what you were hoping it would do?
Offline Profile Goto Top
 
enias
Member
[ *  * ]
what i want is to be able to go freely so any page and copy but the windows doent allow me to do it... a new windows is opened but I have nothing to copy there...
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I'm not sure I understand you, are you saying when you have the prompt box appear, it won't allow you to switch to a new tab or window?
Offline Profile Goto Top
 
enias
Member
[ *  * ]
Exactly, therefore I can not copy and paste
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
What browser are you using? I'm able to switch tabs in Firefox.
Offline Profile Goto Top
 
enias
Member
[ *  * ]
Google Chrome..
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
$('#c_bbcode button:last').after(' <button type="submit" onclick="URLImage(); return false">URL Image</button>');

function URLImage() {
var url;
var image;

$('#c_bbcode').append('<div id="contents"><button type="button" id="url" style="margin-top: 5px">I have a URL copied</button></div>');

$('#url').click(function () {
url = prompt('Insert URL:', '');
$('#contents').html('<button type="button" id="image" style="margin-top: 5px"> I have a image URL copied</button>');

$('#image').click(function () {
image = prompt('Insert Image:', '');
$('#contents').remove();
ZetaInsert('[url=' + url + '][img]' + image + '[/img][/url]');
});
});
}
</script>
Try that instead.
Offline Profile Goto Top
 
Steve
Member Avatar
patriot
[ *  *  *  *  *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic