Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Location
    London
    Posts
    599
    Plugin Contributions
    0

    Default item added - fade out

    I've added a sneaky little effect that shows/ hides an "item added" message.
    Currently the message shows the div then, after a few seconds, hides it again.
    What I want to do is fade out instead of just hide.

    You can see it in action here (click 'add to basket' then message appears top right):
    http://tinyurl.com/sf-effect

    This is the script placed in the head:
    Code:
    <script type="text/javascript">
    function hideIt() {
      document.getElementById("message").style.display = "none";
    }
    setTimeout("hideIt()", 3000); // after 3 sec
    </script>
    Here is the CSS:
    Code:
    .messageStackSuccess {
    	width:100px;
    	float:right;
    	background-color:#b64926;
    	color:#ffff00;
    	text-transform:uppercase;
    	text-align:center;
    	font-size:80%;
    	font-weight:bold;
    	padding-right:20px;
    	}
    Thanks in advance.

  2. #2
    Join Date
    Apr 2008
    Location
    London
    Posts
    599
    Plugin Contributions
    0

    Default Re: item added - fade out

    Forgot to add the code for the actual div that's shown:

    Code:
    <div id="message"><?php
      // Display all header alerts via messageStack:
      if ($messageStack->size('header') > 0) {
        echo $messageStack->output('header');
      }
      if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
      echo htmlspecialchars(urldecode($_GET['error_message']));
      }
      if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
       echo htmlspecialchars($_GET['info_message']);
    } else {
    
    }
    ?></div>

  3. #3
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    18,044
    Plugin Contributions
    1

    Default Re: item added - fade out

    I've always assumed that kind of thing was done with an animated gif, with increasingly faded layers.

 

 

Similar Threads

  1. 2 backgrounds, vertical fade for the center content, horizontal fade for the sides.
    By jamesdavid in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 5 Jun 2009, 05:15 AM
  2. Date an item was added
    By enquirer66 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 Oct 2007, 08:53 AM
  3. Strange blue dots using Dynamic Drive Ultimate Fade In Slideshow on my homepage.
    By gingertea in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 Aug 2007, 08:02 AM
  4. Got an error on page when I added an item on sub category
    By redge in forum General Questions
    Replies: 1
    Last Post: 12 Oct 2006, 09:20 PM
  5. sidebox_middle.gif shows up in wrong place after item added
    By MMN Maniac in forum Addon Templates
    Replies: 9
    Last Post: 19 May 2006, 10:26 AM

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
  •