Hybrid View

  1. #1
    Ext User
    Join Date
    Aug 2009
    Posts
    9
    Vote Rating
    0
    krishnak is on a distinguished road

      0  

    Default Highlight effect like Scriptaculous

    Highlight effect like Scriptaculous


    Gives highlight effect for the elements.

    Usage: params - el, start_color, end_color, duration (millis) [, restore_background_image]
    Code:
    HighlightEffect.highlight(field.el(), "FFD700", "EEE8AA", 2000);
    Code:
    public class HighlightEffect extends SingleStyleEffect {
    
        private int[] base = new int[3];
        private int[] delta = new int[3];
    
        private String backgroundImage;
        private boolean restoreBackgroundImage;
    
        public static void highlight(El el, String from, String to, int duration) {
            highlight(el, from, to, duration, true);
        }
    
        public static void highlight(El el, String from, String to, int duration, boolean restoreBackgroundImage) {
            new Fx().run(duration, new HighlightEffect(el, from, to, restoreBackgroundImage));
        }
        
        protected HighlightEffect(El el, String from, String to, boolean restoreBackgroundImage) {
            super(el);
            this.restoreBackgroundImage = restoreBackgroundImage;
            for (int i = 0; i < 3; i++) {
                int b = Integer.parseInt(from.substring(i * 2, (i + 1) * 2), 16);
                int e = Integer.parseInt(to.substring(i * 2, (i + 1) * 2), 16);
                base[i] = b;
                delta[i] = e - b;
            }
        }
    
        @Override
        public void onUpdate(double progress) {
            StringBuilder sb = new StringBuilder(7).append("#");
            for (int i = 0; i < 3; i++) {
                String v = Integer.toHexString((int) (base[i] + delta[i] * progress));
                sb.append((v.length() < 2) ? "0" : "").append(v);
            }
            el.setStyleAttribute("background-color", sb.toString());
        }
    
        @Override
        public void onStart() {
            this.backgroundImage = el.getStyleAttribute("background-image");
            el.setStyleAttribute("background-image", "none");
        }
    
        @Override
        public void onComplete() {
            if (restoreBackgroundImage) {
                el.setStyleAttribute("background-image", this.backgroundImage);
            }
        }
    }

  2. #2

  3. #3
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    Quote Originally Posted by Hardrun View Post
    Pretty strange code.
    hello spambot,

    i looked over the code and find that there a more pretty strange spam links in your footer ;-)
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

  4. #4
    Ext User
    Join Date
    Oct 2009
    Posts
    1
    Vote Rating
    0
    musyupcu is on a distinguished road

      0  

    Default


    I a trying to make a chat room for a new site design.
    So far to show my enterys i have
    <?php
    require('../PHP/mysql.php');

    $settings = mysql_connect($database_comp,$database_user,$database_pass);
    if (!
    $settings)
    {
    die(
    'Could not connect: ' . mysql_error());
    }

    mysql_select_db($database_db, $settings);

    $chat = mysql_query("SELECT * FROM room1");

    while(
    $show = mysql_fetch_array($chat))
    {
    echo
    '<tr>';
    echo
    '<td width="75">'.$show['username'].' : </td>';
    echo
    '<td width="355"><div align="left">'.$show['text'].'</div></td>';
    echo
    '</tr>';
    }

    mysql_close($settings);
    ?>
    What i would like help with is that if people no html they can put it in so is there a way i can let them choose a style but they cant enter html.