Click on a link (at a iframe) and send the code to txtarea (on topics)
2 posters
Page 1 of 1
Click on a link (at a iframe) and send the code to txtarea (on topics)
I've take this code and i've created a javascript page and applied to all pages. But the page which has the link (a emoticon) is in a frame (host on another site), so how i can place the code of this image when i click on it on textarea of topics (main frame "_top"). I've tested it on the site i've host and it worked fine, but the problem is make it works on main frame.
Re: Click on a link (at a iframe) and send the code to txtarea (on topics)
Hello Chavo,
To access an iframes contents the source must be on the same domain.
Example :
http://generaltesting.forumotion.com/h1-
To access an iframes contents the source must be on the same domain.
Example :
- Code:
$(function() {
$('#emoticons').load(function() {
$('#emoticons').contents().find('img').click(function() {
$('#textArea').val($('#textArea').val() + $(this).attr('alt'));
});
});
});
http://generaltesting.forumotion.com/h1-
Re: Click on a link (at a iframe) and send the code to txtarea (on topics)
And what codes i apply to iframe images? And it really must be hosted on forum?
On forumotion have an limit of maximum html modules?
On forumotion have an limit of maximum html modules?
Re: Click on a link (at a iframe) and send the code to txtarea (on topics)
The code I posted above shows how to access the iframes html contents. For the emoticon codes, it is done by the alt text of the image. We target this attribute and insert its value into the texarea.
To access the contents of an iframe, the iframe source must be on the same domain.
The max number of HTML pages you can have is 500. Please see this topic for limits :
https://help.forumotion.com/t1709-some-limits-of-forumotion-forum
To access the contents of an iframe, the iframe source must be on the same domain.
The max number of HTML pages you can have is 500. Please see this topic for limits :
https://help.forumotion.com/t1709-some-limits-of-forumotion-forum
Re: Click on a link (at a iframe) and send the code to txtarea (on topics)
So, i can put a texbox inside the frame and the person get it just pressing a button...
Have a possibility to switch automatically the theme when your internet is slow.
And can apply a .css from the main frame to iframes on the page? And when switch the theme of the main frame switch on the iframe?
Have a possibility to switch automatically the theme when your internet is slow.
And can apply a .css from the main frame to iframes on the page? And when switch the theme of the main frame switch on the iframe?
Re: Click on a link (at a iframe) and send the code to txtarea (on topics)
If you wanted to append a stylesheet to the iframe you can do :
- Code:
$(function() {
$('#myFrame').load(function() {
$('#myFrame').contents().find('head').append('<link type="text/css" href="/mystyle.css" rel="stylesheet">');
});
});
Re: Click on a link (at a iframe) and send the code to txtarea (on topics)
Two questions
This code will affect all pages on frame? If i go to another page it will be replaced by the theme of the page?
And how i modify this code for example make a list to choice the theme?
This code will affect all pages on frame? If i go to another page it will be replaced by the theme of the page?
And how i modify this code for example make a list to choice the theme?
Re: Click on a link (at a iframe) and send the code to txtarea (on topics)
To apply to all frame pages you would need to append the style again, so you could do something like :
You could set up a list of elements and have them run a function if clicked. You would need to clear the other functions when doing so. So, on click of the new style you would run a similar function above and kill your other intervals by calling clearInterval.
ex :
- Code:
var setStyle = setInterval(function() {
if ($('#myIframe').contents().find('#myStyle').length) return;
$('#myIframe').contents().find('head').append('<link type="text/css" id="myStyle" href="mystyle.css" rel="stylesheet">');
},100);
You could set up a list of elements and have them run a function if clicked. You would need to clear the other functions when doing so. So, on click of the new style you would run a similar function above and kill your other intervals by calling clearInterval.
ex :
- Code:
$('#mybutton').click(function() { clearInterval(setStyle) });
Similar topics
» html form wont send emails changed code but still dont send
» Posting topics that contain <iframe>
» iframe code help
» problem Using iframe as a Target for a Link with youtube
» Click Link
» Posting topics that contain <iframe>
» iframe code help
» problem Using iframe as a Target for a Link with youtube
» Click Link
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum