Wednesday 22 July 2015

How To Animate Move a Image in HTML

Cross fading images


Commonly used as part of image galleries, or to show detail on products. This has traditionally been done in javascript by iterating over the opacity - using CSS transitions makes this very easy to add to your site.

Demo 1 - One image to another, on hover

Plan

  1. Put one image on top of the other
  2. Change the opacity of the top image on hover

Demo

Code

First up, the HTML markup. Without CSS enabled, you just get two images. Remember to add alt text for production use.
<div id="cf">
  <img class="bottom" src="/images/Windows%20Logo.jpg" />
  <img class="top" src="/images/Turtle.jpg" />
</div>
Then the CSS:
#cf {
  position:relative;
  height:281px;
  width:450px;
  margin:0 auto;
}

#cf img {
  position:absolute;
  left:0;
  -webkit-transition: opacity 1s ease-in-out;
  -moz-transition: opacity 1s ease-in-out;
  -o-transition: opacity 1s ease-in-out;
  transition: opacity 1s ease-in-out;
}

#cf img.top:hover {
  opacity:0;
}

Demo 2 - One image to another, when a button is pressed (transitions)

Plan

Same as before, but instead of using the :hover pseudo class, we are going to use javascript to add a toggle a class. I'm using jQuery here because it's easy to understand, though you could just use plain old JS.

Demo

Click me to toggle

Code

First up, the HTML markup. Again, with no CSS enabled, you just get two images.
<div id="cf2" class="shadow">
  <img class="bottom" src="/images/Windows%20Logo.jpg" />
  <img class="top" src="/images/Turtle.jpg" />
</div>
<p id="cf_onclick">Click me to toggle</p>
Then the CSS. I've added a class with the opacity value.
#cf2 {
  position:relative;
  height:281px;
  width:450px;
  margin:0 auto;
}
#cf2 img {
  position:absolute;
  left:0;
  -webkit-transition: opacity 1s ease-in-out;
  -moz-transition: opacity 1s ease-in-out;
  -o-transition: opacity 1s ease-in-out;
  transition: opacity 1s ease-in-out;
}

#cf2 img.transparent {
opacity:0;
}
#cf_onclick {
cursor:pointer;
}
Then the extremely short JS. Note that the browser is smart enough to realise that it can animate to the new properties, I didn't have to set them in javascript (thought that works too).
$(document).ready(function() {
  $("#cf_onclick").click(function() {
  $("#cf2 img.top").toggleClass("transparent");
});
});
Have a look at the multiple image demo to see how to extend this idea to more than two images.

Demo 3 - One image to another with a timer (CSS animations)

Plan

You could implement this by using Javascript to toggle classes with a delay - that would allow older browsers to still have the images change. As we are looking forward though, we'll use CSS keyframes.
  1. Start with two images absolutely positioned on top of each other.
  2. Use CSS keyframes to define two states, one with top image transparent, one with it opaque.
  3. Set the animations number of iterations to infinite.

Demo

Each image is visible for 9 seconds before fading to the other one.

Code

Everything's the same as Demo 1, but I've added this to the CSS and removed the hover selector
  @keyframes cf3FadeInOut {
  0% {
  opacity:1;
}
45% {
opacity:1;
}
55% {
opacity:0;
}
100% {
opacity:0;
}
}

#cf3 img.top {
animation-name: cf3FadeInOut;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-duration: 10s;
animation-direction: alternate;
}
To make sense of that, I've defined 4 keyframes, specified that whatever has this animation attached will be opaque for the first 45%, then transparent for the last 45%. The animation will repeat forever, will last 10 seconds, and will run forward then backwards. In other words, image 1 will be visible for 4.5 seconds, followed by a 1 second fade, followed by 4.5 seconds of image 2 being visible. Then it will reverse, meaning that image 1 and 2 will both be visible for 9 (4.5 x 2) seconds each time.

Demo with multiple images

Staggering the animations can result in a multiple image fader.
This time I've created an animation that goes from 0 to 1 opacity, then staggered the animations so only one is visible at once.
Thanks to Pafson's comment, this is finally working as expected! He proposes the following algorithm to determine the percentages and timings:
For "n" images You must define:
a=presentation time for one image
b=duration for cross fading
Total animation-duration is of course t=(a+b)*n

animation-delay = t/n or = a+b

Percentage for keyframes:
  1. 0%
  2. a/t*100%
  3. (a+b)/t*100% = 1/n*100%
  4. 100%-(b/t*100%)
  5. 100%
@keyframes cf4FadeInOut {
  0% {
    opacity:1;
  }
  17% {
    opacity:1;
  }
  25% {
    opacity:0;
  }
  92% {
    opacity:0;
  }
  100% {
    opacity:1;
  }
}

#cf4a img:nth-of-type(1) {
  animation-delay: 6s;
}
#cf4a img:nth-of-type(2) {
  animation-delay: 4s;
}
#cf4a img:nth-of-type(3) {
  animation-delay: 2s;
}
#cf4a img:nth-of-type(4) {
  animation-delay: 0;
}

Demo 4 - More than just fades

This technique isn't limited to just fades, you can animate almost every property. Here are a couple of examples.

Zooming in and out

Hover on the image

Rotation

Hover on the image

Demo 5 - Animating the background-image property

Right now this only works on webkits built from 2012 onwards. It's not part of the spec (yet?).

Plan

  1. Make a div with a width and height
  2. Change the background-image property

Demo

Code

This only works on Chrome 18+ and on Webkit built in 2012 onwards, including iOS6. It seems to be a side effect of the CSS4 crossfading work, though this is a lot more useful.
<div id="cf6_image" class="shadow"></div>
Then the CSS:
#cf6_image {
  margin:0 auto;
  width:450px;
  height:281px;
  transition: background-image 1s ease-in-out;
  background-image:url("/images/Windows%20Logo.jpg");
}

#cf6_image:hover {
  background-image:url("/images/Turtle.jpg");
}
Pretty cool - this can easily be extended by simply changing the background-image property with JS, and makes things much much simpler. I'm not sure if this behaviour is part of the spec or not, and I haven't seen support anywhere other than in the afore mentioned browsers.
For a slightly more detailed example, have a look at a simple gallery using filters and fades.

Demo 6 -Fading between multiple images on click

Image 1 Image 2 Image 3 Image 4
This is very similar to the others – just layout the images on top of each other, set them all to be transparent, then when the controls are clicked change that one to opaque.
For this example:

HTML

<div id="cf7" class="shadow">
  <img class='opaque' src="/images/Windows%20Logo.jpg" />
  <img src="/images/Turtle.jpg;" />
  <img src="/images/Rainbow%20Worm.jpg;" />
  <img src="/images/Birdman.jpg;" />
</div>
<p id="cf7_controls">
  <span class="selected">Image 1</span>
  <span>Image 2</span>
  <span>Image 3</span>
  <span>Image 4</span>
</p>

CSS

p#cf7_controls {
  text-align:center;
}
#cf7_controls span {
  padding-right:2em;
  cursor:pointer;
}
#cf7 {
  position:relative;
  height:281px;
  width:450px;
  margin:0 auto 10px;
}
#cf7 img {
  position:absolute;
  left:0;
  -webkit-transition: opacity 1s ease-in-out;
  -moz-transition: opacity 1s ease-in-out;
  -o-transition: opacity 1s ease-in-out;
  transition: opacity 1s ease-in-out;
  opacity:0;
  -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
}

#cf7 img.opaque {
  opacity:1;
  -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
  filter: alpha(opacity=1);
}

JS

$(document).ready(function() {
  $("#cf7_controls").on('click', 'span', function() {
    $("#cf7 img").removeClass("opaque");

    var newImage = $(this).index();

    $("#cf7 img").eq(newImage).addClass("opaque");

    $("#cf7_controls span").removeClass("selected");
    $(this).addClass("selected");
  });
});

Thursday 16 July 2015

BEST SITES TO LEARN HOW TO CODE FOR FREE







There are a ton of resources out there to learn coding, most of which are free!!! So why you enroll in expensive training classes.

Here are the best websites where you can learn how to write code in PHP, Java, Android, JavaScript, HTML, CSS, and all the other popular programming languages.

General

1. Codecademy
2. Codewars
3. Coursera
4. edX
5. Free Code Camp
6. GA Dash
7. Khan Academy
8. MIT OpenCourseware
9. The Odin Project
10. Udacity
11. Udemy
12. The Code Player

For more resources see here, look here. 

Youtube Channels         

13. Coder’s Guide
14. DevTips
15. LearnCode.academy
16. thenewboston

For a more comprehensive list of YouTube channels where you can learn to code, look here.    

Blogs

17. A List Apart
18. CSS-Tricks
19. David Walsh
20. Scotch.io
21. Site Point
22. Tuts+

The Command Line


Git and GitHub

27. Try Git

HTML and CSS

28. HTML5 Dog

JavaScript

35. Learn JS

WordPress

36. WordPress.tv
37. WPBeginner

Python

40. Learn Python The Hard Way (Website)

For more best programming tools & resources to learn Python, see here.

Ruby

44. RubyMonk
45. Try Ruby     

Wednesday 15 July 2015

How To Remove shortcut virus From Computer Latest Computer Tricks

How To Remove shortcut virus From Computer Latest Computer Tricks (without any software !!)


Those long computer, using laptop experience for all of them to face more or less the shortcut virus.
 
What is it?(latest computer tricks latest computer software)
How To Remove shortcut virus From Computer Latest Computer Tricks  (without any software !!)
(tips and tricks for computer)
Suddenly, without any reason, he is full of computer files, shortcuts.Repeatedly to delete, again being made.(remove virus from computer)
(google voice app)(remove virus from computer)
Many file-folder is lost and simply unlocked.
(computer all software free download)

Nowadays almost everyone reading this problem.
(remove virus from computer)

It is not a virus.(remove virus from computer)
(latest computer tricks)

This is VBS Script (Visual Basic Script).
(latest computer tricks)
Follow the steps below to get rid of very easily.(remove virus from computer)
Using the CMD
How To Remove shortcut virus From Computer Latest Computer Tricks  (without any software !!)

1. Open CMD (Command Prompt - DOS)(remove virus from computer)
(latest computer tricks)
2. Enter the following command exactly attrib -h -s -r -a / s / d Name_drive: *. * This article Name_drive drive that you want the shortcut to enter the virus. For example: C drive to virus type attrib -h -s -r -a / s /dc:*.*3. Press the Enter button4You will see the files and folders thatthe shortcut virus will become normalI would like to delete the files and foldersBat .bat file usingthe Notepad text file a ekajekiutebalaIt is double-click on.1. Open Notepad.
remove virus from computer
2Copy the following code exactly - paste @echo offattrib -h -s -r -a / s / d Name_Drive: *. * Attrib -h -s -r -a / s / d Name_Drive: *. * Attrib -h -s -r -a / s / d Name_Drive: *. * @ echo complete.3. Name_Drive enter the name of the place, the virus infected drive.

(computer desktop software)
If you are affected more than three drives, the command will simply just copy-paste.4.removevirus.bat diyephailati save the name.5. To close the file dabalaklika run.6. Now you see the folder shortcut virus file is normal.
remove virus from computer
Now delete all.

How To Remove shortcut virus From Computer Latest Computer Tricks  (without any software !!)

The following strategies can also live from infected pen drive

1. Go to RUN.


2. wscript.exe written press ENTER.


3. Stop script after specified number of seconds: Apply through to the 1. The shortcut to the virus and your computer will not enter anyone's pen. Virus infected computer can


1. Press CTRL + SHIFT + ESC key on the keyboard.


2. PROCESS tab.
(remove virus from computer)

3. Here, select the file wscript.exe.


4. Click End Process.


5. Now your computer's C: / drive back.


6. Wscript search using the search box.


7. SHIFT + DELETE all files in the name of wscript.
(remove virus from computer)

8. The files are not deleted, skip the following day

.9. Now go to RUN.

10. wscript.exe written press ENTER.


11. Stop script after specified number ofseconds: with the 1 to APPLY. That shortcut to your computer virus-free.
(remove virus from computer)

Shortcut virus and your computer will not enter the pen drive.

Bhabani Facebook