Results 1 to 5 of 5

Thread: "Lights off" script

  1. #1
    Join Date
    Feb 2009
    Location
    Kansas City, KS
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question "Lights off" script

    You know those buttons where you can click and it'll darken everything around a certain object (game, video) kinda like turning off the lights so you can better focus on playing a game or watching a movie. I tried looking around for one but I don't know what it's called.

    Any help would be cool.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    In HTML or Flash?
    Jeremy | jfein.net

  3. #3
    Join Date
    Feb 2009
    Location
    Kansas City, KS
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Nile View Post
    In HTML or Flash?
    HTML would be preferred. I don't really know much about flash but I want to darken around a flash application.

    Kinda like THIS.

  4. #4
    Join Date
    Feb 2009
    Location
    Kansas City, KS
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    lol, nothing?

  5. #5
    Join Date
    Feb 2009
    Location
    Kansas City, KS
    Posts
    24
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Okay so I went to Youtube and view sourced the page. I found this snippet but I have to clue what do do with it.

    Code:
    function toggleLights(lightsOff) {
    			if (lightsOff) {
    				addClass(document.body, 'watch-lights-off');
    			} else {
    				removeClass(document.body, 'watch-lights-off');
    			}
     
    			if (!lightsOff) {
    				hideDiv('watch-longform-shade');
    			} else {
    				_gel('watch-longform-shade').style.height = parseInt(_gel('baseDiv').offsetHeight) + 'px';
    				showDiv('watch-longform-shade');
    			}
    		}
     
    		onLoadFunctionList.push(function() {
    			addListener(document.body, 'click',	function(e) {
    				stopPropagation(e);
     
    				var evt = e || window.event;
    				var target = evt.target || evt.srcElement;
    				if (!hasAncestor(target, 'watch-longform-buttons')) {
    					toggleLights(false);
    				}
    			});
    		});

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
  •