Showing posts with label FadeIn. Show all posts
Showing posts with label FadeIn. Show all posts

Wednesday 26 February 2014

Flex Slider With Animation "slide" and "Fade" Effect

FlexSlider 2 is the most powerful slider available. Fully responsive; Retina display support (image slider types only) (New); Easing effects (New) and more. The plugin requires jQuery 1.4.2 and above.

 Flex Slider with Animation "Slide" Effect

Flex Slider Animation "Slide" Effect
Screen 1
Flex Slider with Animation "Fade" Effect


Flex Slider Animation "Fade" Effect
Screen 2
To Add Flex Slider you need to add this file in head tag :
1. flexslider.css
2. jquery-1.7.2.min
3. jquery.flexslider.js


Script :

<script type="text/javascript">
        // Can also be used with $(document).ready()


        //Flex Slider Animation "slide" Effect
        $(window).load(function() {
            $('#flexSlide').flexslider({
                animation: "slide"
            });
        });


        //Flex Slider Animation "fade" Effect
        $(window).load(function() {
            $('#flexsliderFade').flexslider({
                animation: "fade"
            });
        });
         
    </script>





HTML :


//Place this html code inside div tag
<h1>
                Flex Slider</h1>
            <div>
                //Place somewhere in the <body> of your page                 <h2 align="left" style="border-bottom: solid 1px white;">
                    Flex Slider Animation "slide" Effect
                </h2>
                <div id="flexSlide" class="flexslider">
                    <ul class="slides">
                        <li>
                            <img src="Images/Screen 1.jpg" />
                        </li>
                        <li>
                            <img src="Images/Screen 2.jpg" />
                        </li>
                        <li>
                            <img src="Images/Screen 3.jpg" />
                        </li>
                        <li>
                            <img src="Images/Screen 4.jpg" />
                        </li>
                    </ul>
                </div>
            </div>
            <div>
            <h2 align="left" style="border-bottom: solid 1px white;">
                    Flex Slider Animation "Fade" Effect
                </h2>
                <div id="flexsliderFade" class="flexslider">
                    <ul class="slides">
                        <li>
                            <img src="Images/Screen 1.jpg" />
                        </li>
                        <li>
                            <img src="Images/Screen 2.jpg" />
                        </li>
                        <li>
                            <img src="Images/Screen 3.jpg" />
                        </li>
                        <li>
                            <img src="Images/Screen 4.jpg" />
                        </li>
                    </ul>
                </div>
            </div>


General Notes


Two new methods are available for adding/removing slides, slider.addSlide() and slider.removeSlide(). More details about this coming soon.
  • slider.addSlide(obj, pos) accepts two parameters, a string/jQuery object and an index.
  • slider.removeSlide(obj) accepts one parameter, either an object to be removed, or an index. 

For more details and properties visit : FlexSlider 2.2.2 Updates, General Notes, Examples, Properties

Download Link :

Download Complete Project Link

If you have any query feel free to comment it will be appreciated :)


Friday 27 December 2013

javascript - jQuery fading "Back To Top" link


Here i am explaining how to add javascript - jQuery fading "Back To Top" link

We need to style and position it. Here I’m setting its position to fixed and adding the image of "Back To Top". I also added the Fade In and Fade Out effect.

Back To Top

Script

//Add This Jquery CDN
<script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.1.min.js">
 </script>


//A Simple FadeIn and FadeOut Effect Back to top
<script type="text/javascript">
        $(function() {
            $(window).scroll(function() {
                if ($(this).scrollTop() != 0) {
                    $("#toTop").fadeIn();
                }
                else {
                    $("#toTop").fadeOut();
                }
            });
            $('#toTop').click(function() {
                $('body,html').animate({ scrollTop: 0 }, 800);
            });
        });
</script>


CSS

<style type="text/css">
        #toTop
        {
            position: fixed;
            bottom: 50px;
            right: 30px;
            width: 180px;
            height:100px;
            padding: 5px;         
            cursor:pointer;
            display: none;
        }
</style>

 

HTML

//This is the Fixed div
<div id="toTop">
        <img src="images/BackToTopArrow.png" style="width: 250px;
            height:100px;" alt="back to top" title="back to top" />
</div>


If you have any query feel free to comment it will be appriciated :)