Search Results

Search found 2 results on 1 pages for 'techydude'.

Page 1/1 | 1 

  • Simple Counter issue

    - by TechyDude
    I want to make a very simple counter that increases the value when you click a button. When I click the add button the first time, the number doesn't increase, however I console log the value which increases the result everytime. Any ideas? The fiddle: http://jsfiddle.net/techydude/H63As/ $(function() { var //valueCount = $("counter").value(), counter = $("#counter"), addBtn = $("#add"), value = $("#counter").html(); addBtn.on("click", function() { counter.html(value ++); console.log(value); return }); });

    Read the article

  • generate random opacity number using math random

    - by TechyDude
    I am trying to generate a random number for the css opacity. This is what I tried so far. CSS .test{ position : absolute; width : 15px; height : 15px; border-radius:15px; background-color : black; }? Script $(function() { for (var i = 0; i < 300; i++) { $("<div>", { class: "test", css: { opacity: randomOpacity } }).appendTo("body"); } function randomOpacity() { var opac = 0; opac = Math.random() < 1; console.log(opac); } randomize(); });? The Fiddle

    Read the article

1