SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    May 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fadein Image and iframe

    Hello everybody excuses me my writing english, i need your help for code jquery, i like all image fadein when webpage loaded! check here code.. thank you for your time :D

    HTML Code:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript"> 
    $(document).ready(function(){
    $("img").fadeIn("slow");
    $("div").fadeIn();
    $("iframe").fadeIn(4500);
    $(this).css('background-image', 'url(EggA_' + c-bg + '.jpg)').fadeIn(2500);
    });
    </script>

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    The .ready() method fires long before the images have loaded.

    You may need to use the .load() method for that instead, so that it occurs after the images are available.
    Last edited by paul_wilkins; Jul 10, 2012 at 19:06.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Member
    Join Date
    May 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for reply just i figure and found out need to CSS use display:none and will works image fadeIn so the code can help other people

  4. #4
    SitePoint Member
    Join Date
    May 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I like to share to other people, how code works !

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    $("img").fadeIn("slow");
    $("div").fadeIn("Slow");
    $("iframe").fadeIn("slow");
    });
    </script>

    <style type="text/css">
    img {
    display:none;
    }

    div {
    display:none;
    }
    </style>



Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •