JavaScript - Trying To Set Clip
I'm trying to set the clip of an image dynamically, but I cannot get the script to work at all. I've tried it with and without spaces, with and without the 'px', and with and without commas, but I can't get it to work. I tried just simply setting it without passing in the variable, and it still wouldn't work.
Here's what I'm using: Code: <script type="text/javascript"> var winW = window.innerWidth; if (winW < 1200) { document.getElementById('pic').style.clip="rect(0px," + winW + "px,350px,0px)"; } </script> <style type="text/css"> #pic { position: absolute; top: 0; left: 0; overflow: hidden; width: 1200px; height: 350px; } </style> Similar TutorialsI have a copy to clip board function in a page for short cut notes but currently it is enbeded with several copy to options ... hear is a part of the code ... [code] <html> <head> <title>Case Shortcut 1.0</title> </head> <SCRIPT language=JavaScript src="xxxxxxx"></SCRIPT> <BODY bgcolor=cccccc onload="loadPin('one')"> <table border="0" bordercolor="#000000" style="background-color:#FFFFCC" width="500" cellpadding="3" cellspacing="3"> <tr> <td> <SCRIPT LANGUAGE="JavaScript"> function ClipBoard1() { holdtext1.innerText = copytext1.innerText; Copied1 = holdtext1.createTextRange(); Copied1.execCommand("Copy"); } </SCRIPT> <SPAN ID="copytext1" STYLE="height:*;width:300;background-color:White"> xxxxxx. I called and left message with callback number and pin. Callback Number: bbbbbbbbbbb PIN <SCRIPT language=JavaScript src="http://doris/res/scripts/datePin.js"></SCRIPT> <SPAN id=datepinHolder></SPAN></SPAN> <TEXTAREA ID="holdtext1" STYLE="display:none;"> </TEXTAREA> <BUTTON onClick="ClipBoard1();">Copy Note</BUTTON> <p> <SCRIPT LANGUAGE="JavaScript"> function ClipBoard11() { holdtext11.innerText = copytext11.innerText; Copied11 = holdtext11.createTextRange(); Copied11.execCommand("Copy"); } </SCRIPT> <SPAN ID="copytext11" STYLE="height:*;width:250;background-color:White"> 5 Day Pending close Message Left on Voice Mail. </SPAN> <TEXTAREA ID="holdtext11" STYLE="display:none;"> </TEXTAREA> <BUTTON onClick="ClipBoard11();">Copy Note</BUTTON> <p> <SCRIPT LANGUAGE="JavaScript"> function ClipBoard10() { holdtext10.innerText = copytext10.innerText; Copied10 = holdtext10.createTextRange(); Copied10.execCommand("Copy"); } </SCRIPT> <SPAN ID="copytext10" STYLE="height:*;width:250;background-color:White"> xxxxxx. Unable to leave Voice Mail will contact again on </SPAN> <TEXTAREA ID="holdtext10" STYLE="display:none;"> </TEXTAREA> <BUTTON onClick="ClipBoard10();">Copy Note</BUTTON> <p> [code] Is there a way that I code not have to repate code ... can it be condinced. Hey folks, I'm really wanting to mess around with doing something like the button at the bottom of this web page: http://www.major-confusion.co.uk/tut...sh-button.html The button has a short looping animation that plays when the button is moused over. It could create a very cool effect. Any JS gurus know if this or something similar can be done using JS and/or html5? I'm trying to avoid using flash at all costs. Thanks in advance. Hi Friends, I need a copy to clipboard functionality from a text area using javascript. I use Zclip for the purpose, but it will not work as needed . I attach my working code along with this .. pls open index.html in browser and try it . Do any one can pls give a javascript solution to copy textarea content to clipboard... Thanks, Anes |