Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Steve Bondy

@Steve Bondy
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • look for a free screenshot software
    S Steve Bondy

    Greenshot is the best IMO. And it's free. Greenshot for Windows Very versatile so you can configure it to suit your workflow and preferences.

    The Lounge question

  • Digital Dementia
    S Steve Bondy

    I've made it a point over the years to not use technology for that very reason. I use the contact list in my phone to store numbers, but I'll look them up and then dial manually to help me memorize the number. I'll do math problems in my head just for practice, or do an estimate in my head to double check what came up on the calculator in case I make an entry error. Stuff like that. Steve

    The Lounge html question

  • Need help understanding binding
    S Steve Bondy

    Hi all, I'm an old C++ programer who has dabbled in web coding and javascript over the years. Lately I've been trying to get a handle on the mooTools framework for javascript. I'm having a bit of trouble understanding how javascript handles binding, or it may be a mootools binding thing, I'm not sure. Any insight is appreciated. The following code works:

    var myMenu = new Class({

    initialize: function(elements, options){
    <!-- <snip>  -->
    // Add mouseenter and mouseleave events to each of the menu elements
        this.elements.each(
        function(el,i){
                var obj = this;
                el.addEvent('mouseenter', function(evnt){
                   obj.menuOpen(i);
                });
                el.addEvent('mouseleave', function(evnt){
                   obj.menuOpen(null);
                });
            }.bind(this) // end of function(el,i)
    );  // end of this.elements.each
    
    }, // End of initialize function
    

    menuOpen(evnt, i) {
    .... do menu stuff ....
    }
    <!-- <snip> -->
    });

    The anonymous function coded in-line with the call to addEvent works properly and my menu items open and close as expected. What I tried, because it looks better to my C++ trained eyes, and to see if I understood things correctly was this:

    var myMenu = new Class({

    initialize: function(elements, options){
    <!-- <snip>  -->
    
    mouseEnter: function(evnt, i){
                   this.menuOpen(evnt, i);
                },
    mouseLeave: function(evnt){
                   this.menuOpen(null);
                },
    
    // Add mouseenter and mouseleave events to each of the menu elements
    this.elements.each(
            function(evnt,i){
                var obj = this;
                el.addEvent('mouseenter', obj.mouseEnter(evnt, i));
                el.addEvent('mouseleave', obj.mouseLeave(evnt, i));
            }.bind(this) // end of function(el,i)
    );  // end of this.elements.each
    

    }, // End of initialize function

    menuOpen(evnt, i) {
    .... do menu stuff ....
    }
    <!-- <snip> -->
    });

    This does not work (nothing happens), yet to me it looks like it should. I'm pretty sure it has to do with binding the functions to the proper object in the addEvent calls (or something) but none of the things I've tried have worked. If you can give some clues to help me understand what's going wrong here I'd

    JavaScript c++ javascript wpf wcf help

  • Fantastic site demonstrating and teaching "responsive" UI concepts using JavaScript, HTML 5, etc.
    S Steve Bondy

    Thanks for this Bill, looks like some good stuff there. Steve

    JavaScript javascript design html css mobile
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups