• Fixing a header after scrolling to a certain point

    Fixing a header after scrolling to a certain point

    Fixing a header after scrolling to a certain point For this we have to use javascript for fixing header at a certain point. $(document).scroll(function() { var y = $(document).scrollTop(); header = $(“#menu”); if (y >= 200) { header.css({ position: “fixed”, “top”: “0”, “left”: “0” }); } else { header.css(“position”, “relative”); } }); So here #menu… Read more

  • Parallax Scrolling Effect

    Parallax Scrolling Effect

      Parallax Scrolling Effect This is purely based on html and css. Parallax is an effect where the position of an object seems to be different when viewed from different positions. Parallax motion, or in our case, parallax scrolling, then gives us the illusion that two objects in the same line of sight, but with… Read more

  • Asymptotic Notations

    Asymptotic Notations

    The following 3 asymptotic notations are mostly used to represent time complexity of algorithms. 1) Θ Notation: The theta notation bounds a functions from above and below, so it defines exact asymptotic behavior. A simple way to get Theta notation of an expression is to drop low order terms and ignore leading constants. For a… Read more

  • Understanding USB cable Types

    Understanding USB cable Types

    Understanding USB cable Types   Computers and electronic devices have some form of USB connection, and many devices also come packaged with a USB cable. What are all these different cables for and does it matter which one you use? For now, yes it does matter. This may change in the near future. Universal Serial… Read more

  • Change file_field_tag appearance

    Change file_field_tag appearance

    Change file_field_tag appearance   HTML: <span class=”btn btn-large btn-warning btn-file”> Choose File <%= file_field_tag :attachment %> </span> CSS: .btn-file { position: relative; overflow: hidden; } .btn-file input[type=file] { position: absolute; top: 0; right: 0; min-width: 100%; min-height: 100%; font-size: 100px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; background: white; cursor: inherit; display: block; } Read more

  • Ruby on Rails: putting class with submit_tag

    Ruby on Rails: putting class with submit_tag

    Ruby on Rails: putting class with submit_tag <%= submit_tag(“Update”, :id=>”button”, :class=>”Test”, :name=>”submit”) %> First parameter is required and it would be value and they any parameter you want to specify, can be done in a hash like :key=>”value”. Read more

Advertisements