Jump to content

Search the Community

Showing results for tags 'jscript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 5 results

  1. https://www.w3schools.com/js/js_break.asp below heading: JavaScript Labels "The continue statement (with or without a label reference) can only be used to skip one loop iteration." - this description is not correct "The continue statement (with or without a label reference) can only be used to skip all or the remainder of one loop iteration." - this description is more accurate
  2. Short way of writing

    Hi Is there a shorter way of writing the following code. (data === "item1" || data === "item2" || data === "item3" || data === "item4") like (data === "item1" to data === "item4") as my list will be over 100 items. Cheers Heres a jsfiddle with the code in it http://jsfiddle.net/8mw1s2zj/6/ Please note this only has to work on IE11 and be jscript. Here is the piece of code var list=document.querySelectorAll("#dragsource li"); for(i=0;i<list.length;i++){ list.draggable=true; list.ondragstart=function(event){ var event=event||window.event; var dt=event.dataTransfer; dt.setData("text", event.target.id); dt.effectAllowed="move"; var data = dt.getData("text"); if((document.getElementById("onoff").value=="On") && (data === "item1" || data === "item2" || data === "item3" || data === "item4")) { (document.getElementById("fruit").style.color = "red") && (document.getElementById("veg").style.color = "black") && (document.getElementById("games").style.color = "black"); } else if((document.getElementById("onoff").value=="On") && (data === "item5" || data === "item6" || data === "item7" || data === "item8")){ (document.getElementById("veg").style.color = "red") && (document.getElementById("fruit").style.color = "black") && (document.getElementById("games").style.color = "black"); } else if((document.getElementById("onoff").value=="On") && (data === "item9" || data === "item10" || data === "item11" || data === "item12")) {(document.getElementById("games").style.color = "red") && (document.getElementById("fruit").style.color = "black") && (document.getElementById("veg").style.color = "black"); } else if((document.getElementById("onoff").value=="Off") && (data === "item1" || data === "item2" || data === "item3" || data === "item4" || data === "item5" || data === "item6" || data === "item7" || data === "item8" || data === "item9" || data === "item10" || data === "item11" || data === "item12")) { (document.getElementById("fruit").style.color = "black") && (document.getElementById("veg").style.color = "black") && (document.getElementById("games").style.color = "black"); } }; }
  3. UPDATE - Drag & Drop is working But need dropped item to be invisable. Again this was working, code in css #fruit > * { display: none; } Code done for each box New jsfiddle -jsfiddle.net/eru2mc2k/1/ Hi My first post here so hope I've posted everything correct. My drag & drop was working fine until I added the following code in script. shuffleList(); function shuffleList(){ var origList = $("#dragsource li").detach(); var newList = origList.clone(); for(var i=0; i<newList.length; i++) { var randomIndex = randomInt(newList.length - i); newList[i] = origList.splice(randomIndex, 1); $("#dragsource").append(newList[i]); } } function randomInt(maxNum){ return Math.floor(Math.random()*maxNum); } $(document).ready(function () { var $lis = $("#dragsource li").hide(); $lis.slice(0,20).show(); var size_li = $lis.length; })I The above code shuffles my list and displays 20 items from it ,which I need Can someone please look at this so the drag and drop work again. Thank you. Here's jsfiddle http://jsfiddle.net/W4Km8/8725/
  4. Problems With Slider

    On my website the slider is not working as desired. The website is www.dancecityperformingarts.com When you click on the name of the dance class the slider moves, but does not move to the page that has the dance class description. It stays at the picture with the business description. When you click on the "details" portion, it takes you to the page that has the correct class description, but the slider does not move to the correct picture. Can anyone tell me if this can be corrected, and if yes, how to correct. I am very new to coding, and I apologize if this is phrased incorrectly or if additional information is needed. ATTN: Moderators, this is my first post. I did read the guidelines and hope I complied. Please advise if I screwed anything up. Thanks for any assistance with my coding problem.
  5. Functions in jscript

    Please forgive me, I'm new at this and old, so the going is slow. 1. If you place multiple functions in .js file, can a functions overwrite or negate other functions? If so, is there special designation that need to be placed in .js file. I'm having trouble with functions not working on the webpage like buttons not working correctly after adding a another function. (I'm not on a live webpage - just learning) 2. Are js files exclusively for functions? Can other things be placed in a .js file besides code that start with function because I've tried other things like example below and could not get them to work in the .js file. example: document.getElementById("bark").innerHTML ="The temperature is " + toCelsius(32) + " Centigrade";‚Äč I had to post that directly in to the body to work. This example is from the tutorial. Any help would be appreciated thanks
×