The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Copy to clipboard

View previous topic View next topic Go down

Copy to clipboard

Post by X-jvlr.FR3$H-X on November 24th 2011, 4:28 am

i would like a working copy to clipboard java/jquerey code

X-jvlr.FR3$H-X
Forumember

Posts : 45
Reputation : 2
Language : english

Back to top Go down

Re: Copy to clipboard

Post by X-jvlr.FR3$H-X on November 25th 2011, 11:13 pm

BUMP

X-jvlr.FR3$H-X
Forumember

Posts : 45
Reputation : 2
Language : english

Back to top Go down

Re: Copy to clipboard

Post by SLGray on November 25th 2011, 11:29 pm

Please explain a little more what you are wanting to know.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35613
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Re: Copy to clipboard

Post by sgeorge on November 26th 2011, 12:26 am

I think he needs a code that the user will press on the link and the content will be automatically copied to clipboard using java/jquery

sgeorge
Forumember

Male Posts : 556
Reputation : 15
Language : Greek - English
Location : Greece

Back to top Go down

Re: Copy to clipboard

Post by X-jvlr.FR3$H-X on November 27th 2011, 7:38 am

yes wat george said

X-jvlr.FR3$H-X
Forumember

Posts : 45
Reputation : 2
Language : english

Back to top Go down

Re: Copy to clipboard

Post by X-jvlr.FR3$H-X on November 27th 2011, 10:29 pm

BUMP

X-jvlr.FR3$H-X
Forumember

Posts : 45
Reputation : 2
Language : english

Back to top Go down

Re: Copy to clipboard

Post by X-jvlr.FR3$H-X on November 28th 2011, 8:55 pm

PLZ HELP

X-jvlr.FR3$H-X
Forumember

Posts : 45
Reputation : 2
Language : english

Back to top Go down

Re: Copy to clipboard

Post by Omu on November 28th 2011, 9:05 pm


Omu
Active Poster

Male Posts : 1019
Reputation : 86
Language : Romanian, English, French
Location : Romania

http://supportdrops.com/

Back to top Go down

Re: Copy to clipboard

Post by Guest on November 28th 2011, 9:11 pm

Code:
div.messaging-box fieldset dl dt label,div.messaging-box fieldset dl dd input.inputbox{
display: none;
}

Guest
Guest


Back to top Go down

Re: Copy to clipboard

Post by X-jvlr.FR3$H-X on November 28th 2011, 9:19 pm

im talkning copy to clipboard

X-jvlr.FR3$H-X
Forumember

Posts : 45
Reputation : 2
Language : english

Back to top Go down

Re: Copy to clipboard

Post by Guest on November 29th 2011, 3:02 pm

Sorry, I posted that code in wrong topic. About your problem. I don't understand which clipboard do you mean. The topic that Gyzmo have wroted? Smile

Guest
Guest


Back to top Go down

Re: Copy to clipboard

Post by blindbat1457 on November 29th 2011, 8:43 pm

He wants it to where a user clicks on a posted link and it copies to the clipboard, kind of like how when you click on the direct link in photobucket and it copies it to your clipboard for pasting.

blindbat1457
Forumember

Male Posts : 667
Reputation : 6
Language : English
Location : Santa Clarita, CA

Back to top Go down

Re: Copy to clipboard

Post by Omu on November 29th 2011, 8:50 pm

Try this:

Code:
        function selectCode(a)
            {
            // Get ID of code block
            var e = jQuery(a).closest('tr').next().find('.cont_code')[0];
       
            // Not IE
            if (window.getSelection)
            {
            var s = window.getSelection();
            // Safari
            if (s.setBaseAndExtent)
            {
            s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
            }
            // Firefox and Opera
            else
            {
            // workaround for bug # 42885
            if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
            {
            e.innerHTML = e.innerHTML + ' ';
            }
       
            var r = document.createRange();
            r.selectNodeContents(e);
            s.removeAllRanges();
            s.addRange(r);
            }
            }
            // Some older browsers
            else if (document.getSelection)
            {
            var s = document.getSelection();
            var r = document.createRange();
            r.selectNodeContents(e);
            s.removeAllRanges();
            s.addRange(r);
            }
            // IE
            else if (document.selection)
            {
            var r = document.body.createTextRange();
            r.moveToElementText(e);
            r.select();
            }
            }
            jQuery(function(){
       
            jQuery('div.postbody td.code').parent().prev().find('b').html.Select('Code:
            <a href="javascript:void()" onClick="selectCode(this)"><font
            face="verdana" color="red"></font> Select Content </a>');
            });

Omu
Active Poster

Male Posts : 1019
Reputation : 86
Language : Romanian, English, French
Location : Romania

http://supportdrops.com/

Back to top Go down

Re: Copy to clipboard

Post by Gangstar15 on November 29th 2011, 10:41 pm

He wants a code like if you click a link it will copy the content without using CTRL + C or right click and Copy... (:

But try search in google for: Copy to clipboard javascript (:

Gangstar15
Forumember

Female Posts : 392
Reputation : 163

http://www.designdrops.net/

Back to top Go down

Re: Copy to clipboard

Post by blindbat1457 on November 30th 2011, 12:09 am

Well I guess worst case scenario he does what was posted and post links within [ code ] tags.

blindbat1457
Forumember

Male Posts : 667
Reputation : 6
Language : English
Location : Santa Clarita, CA

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum