Search the Community
Showing results for tags 'javascrip'.
-
Hi, Im trying to subtract 3 from the value If the radio button is checked. However, its not working. <script type="text/javascript"> function calcShipping() { var txtWeight, pound1, pound2, pound3, freq, notfreq, freq1; var values = " "; freq1 = 3; pound1 = 5; pound2 = 10; pound3 = 15; txWeight = document.getElementById("txtWeight").value; txWeight=parseInt(txWeight); if (txWeight < 1)
-
Hello, I started learning JavaScript this week and I've been mostly using the JavaScript tutorial. It's been great, thanks a lot to all the authors! However, unless I'm mistaken and still don't fully understand, there is some information that I think is wrong or misleading about variable scopes. It prevented me from understanding closures until I worked through other people's code about main loops and did some testing. On the Function Closures page, it says: "Local variables have short lives. They are created when the function is invoked, and deleted when the function is
-
I want do to a simple thing : I have a two scrolls website, and I want to hide the right part when the scroll is at the maximum on the right part. SO I used document.onscroll = function() { if (window.innerHeight + window.scrollY > document.body.offsetHeigh... but the right part is hidden when the scroll is at his max on left part. How Can I do ? the code pen with the precise problem : https://codepen.io/marie-fran-oise-talbot/pen/LKeqBE thank youuuuu
-
Im am trying to assign the function of my dropdown menu so when you click on the selected county it will focue on that countie. I have written out what I can below, through research as I am new to all this, but am not sure how to link it all together. I know I haven't got the googlemaps attached but I do in my full page, it is just this section i am having trouble in trying to link together. <!doctype html> <html> <head> <script type="text/javascript"> document.getElementById('counties').addEventListener('click', function(e) {alert
-
Hi w3 Community i want to learn how to replicate this effect on the main screen of this website https://overv.io/ The traget(booklets) starts off somewhere fixed and translate/rotates towards 0 once it's reached it's original location, scrolling further down won't change any location scrolling back up with move the items back towards the location it stated. Here's something which i think it should look like.. window.onscroll = function() {var speed = 1; //this should be adapted to the height of divvar startdeg = 130; //var startx = 300;var starty =-300;var scroll = $(window).scrollTop(