Jump to content

10 weber

  • Content Count

  • Joined

  • Last visited

Everything posted by 10 weber

  1. Anybody?Maybe it could help if I didn't use HTML5 attributes in the example, as in:<asp:TextBox ID="txt1" type="password" style="color:blue;" ...>
  2. I wrote in a web masterpage <div style="display:inline-block; background-image:url(Images/star.svg); width:<%=((int)Session["adminLevel"] * 31) %>px; height:30px;"></div><div style="display:inline-block; background-image:url(Images/emptyStar.svg); width:<%=(93 - (int)Session["adminLevel"] * 31) %>px; height:30px;"></div> to show users their adminLevel parameter. It's supposed to show a bar of 3 stars, some of which are full and the other empty. To do that I wrote Server Error in '/' Application.Object reference not set to an instance of an object.Descrip
  3. Is it possible to add HTML attributes to asp.net controls directly? i.e. as control attributes (<asp:TextBox ID="txt1" pattern="\w{2,}( \w{2,})*" required="required" ...>) instead of using JavaScript (document.getElementById("txt1").setAttribute("pattern","\w{2,}( \w{2,})*");document.getElementById("txt1").setAttribute("required","required");).
  4. Is there a way to get the handlers of an element? For example, say we have executed window.addEventListener("click",...); and we want to get it's handler. If it had been added with window.onclick = ... it would have been easy, but what do we do in this case?
  5. Is there a way to access the style of selected content without the window.getSelection() JS function?
  6. 10 weber


    I tried to change preview() tofunction preview(x, y) { cntxt.beginPath(); cntxt.clearRect(0, 0, cnvs.width, cnvs.height); cntxt.restore(); cntxt.save(); cntxt.moveTo(lastX, lastY); cntxt.lineTo(x, y); cntxt.stroke();} but it still doesn't work.
  7. 10 weber


    Firefox (using firebug), chrome and opera didn't find any errors.If I run clear after restore it erases the lines that (should) have been restored.
  8. 10 weber


    That's what cntxt.restore() (in preview()) should do - draw the saved lines (saved with cntxt.save() in beginLine()). For some reason it doesn't work.
  9. I'm not sure I understand, but you can copy the next code to the Tryit Editor:<html><head><script type="text/javascript">var iframe;window.onload = function(){iframe = open("", "iframe");};</script></head><body><iframe name="iframe" style="width:100%;"></iframe><br/><input type="text" id="url" style="width:100%;" /><br/><button onclick="document.getElementById('url').value = iframe.location.href;">getURL</button><button onclick="iframe.location.href = document.getElementById('url').value;">setURL</button>
  10. You can open the iframe with the JS window.open function and get it's url by using location.href://define:var iframe = open([i]url[/i], [i]iframe's_name[/i]);//getURL:iframe.location.href
  11. 10 weber


    I tried to use the canvas tag to allow users to draw shapes, but drawing a new line causes all other lines to disappear. <!DOCTYPE html><[color="#0000FF"]html[/color]><[color="#0000FF"]head[/color]> <![color="#FF0000"]-- ... --[/color]> <[color="#0000FF"]script [/color]type="[color="#FFA500"]text/javascript[/color]"> //<![CDATA[ var cnvs, cntxt; window.onload = function () { cnvs = document.getElementById("cnvs"); cntxt = cnvs.getContext("2d"); //... };[b] var lastX, lastY; function begi
  12. I'm looking for a good ASP.NET-C# tutorial online. Can anyone recommend something? (W3schools use VB script and the tutorials in Google are not comprehensive enough)
  13. I prefer not to ask users to change their settings, and using JS will significantly increase loading time (the page contains hundreds of inputs). Are you sure there's nothing to change that?
  14. I wrote enableviewstate="false" in a <form> tag, but FF doesn't restart the form's data on postback (e.g. the <input type="checkbox" checked="checked" /> doesn't get checked back after 'unchecking' it and restarting the page).?
  15. Is there a suggestions form at w3.org? I want to suggest that selector.
  16. I would like to use CSS (without JS) to change an element's style when the mouse is over a specific child. This code doe's the opposite (changes the child's style when you mouse over it's parent): <style type="text/css">#child {color:Black;}#parent:hover #child {color:Blue;}</style><div id="parent">text<div id="child">text</div></div> How can I effect the parent?
  17. I added a new javascript link to my bookmarks toolbar, that turns the body element editable on the first click, and back to normal on the second:javascript:document.body.contentEditable = !document.body.isContentEditable; void(0);It works great on the first click, but in FF the second doesn't do anything. Why?
  18. It works now, though I still want to know what the problem was.Thanks!
  19. I added document.getElementById("temp").innerHTML += "<br />i = " + i + ",opacity = " + alrt.style.opacity; after the setTimeout of each loop, (and a new element: <span id="temp" style="position:absolute; top:0; left:0;"></span> in the body), and got an interesting result - though the opacity is reduced, the alrt.style.opacity remains 1 (but I can still see the the element gradually disappears), and when it's supposed to increase it remains 0 (this time the element changes it's appearance just once, to opacity:0.04).The result in the <span id="temp" ...>:i = 0,opacity
  20. This script is activated on a massage. There is no problem hiding it (the massage), but instead of showing up (the opacity was supposed to gradually increase to 1), it stops when opacity:0.04; var alrt = document.getElementById("alrt");// ...function showAlrt(isShow) { if (isShow) { //works for (var i = 0; i < 700; i += 28) setTimeout("alrt.style.opacity -= 0.04;", i); //For IE there is another script, in <!--[if IE]><![endif]-->, with filters.alpha.opacity setTimeout("alrt.style.display = 'none';", 672); } else { alrt.st
  • Create New...