Jump to content
MakeWebGames

Djkanna

Members
  • Posts

    3,138
  • Joined

  • Last visited

  • Days Won

    36

Everything posted by Djkanna

  1. Still get round to doing it! ^.^ As said mines dirty&quick and needs improving (or scrapped) :P
  2. I got rather bored, so I did a quick and dirty (very) plugin for this, also allows hours [js] (function($){ $.fn.countdown = function (options) { options = $.extend({ start : '1,1,1', countdownTitle: 'Till the end of the world', countdownCompleteMsg: 'Timer has completed.' }, options); return this.each(function () { var unit = options.start.split(','), hour = unit[0], min = unit[1], sec = unit[2]; html = [ '<p class="clock">', '<span class="hour">', hour,'</span> Hours ', '<span class="min">', min,'</span> Minutes ', '<span class="sec">', sec,'</span> Seconds ', '<span>', options.countdownTitle,'</span>', '</p>' ].join(''); $(html).appendTo(this); var clock = $(this); setInterval(function () { var h = $('.hour', clock); m = $('.min', clock), s = $('.sec', clock); if (parseInt(h.html()) <= 0 && parseInt(m.html()) > 0) { clock.html('<span class="min">'+m.html()+'</span> Minutes <span class="sec">'+s.html()+'</span> seconds '+options.countdownTitle); } else if (parseInt(h.html()) <= 0 && parseInt(m.html()) <= 0) { clock.html('<span class="sec">'+s.html()+'</span> seconds ' + options.countdownTitle); } if (parseInt(h.html()) > 0 && parseInt(m.html()) <= 0 && parseInt(s.html()) <= 0) { h.html(h.html() -1); m.html(59); s.html(59); } if (parseInt(m.html()) > 0 && parseInt(s.html()) <= 0) { m.html(m.html() -1); s.html(59); } if (h.length == 0 && m.length == 0 && parseInt(s.html()) == 0) clock.html(options.countdownCompleteMsg); else s.html(parseInt(s.html() -1)); }, 1000); }); } })(jQuery);[/js] Usage [js] $(elem).countdown(); //Will apply the default settings $(elem).countdown({ start: '2,30,30' }); //Will start the countdown at 2 hours 30 minutes and 30 seconds. $(elem).countdown({ start: '0,40,0' }); // Will start the countdown at 40 minutes. //There's two other options 'countdownTitle' and 'countdownCompleteMsg' //countdownTitle is what appears after the countdown, using the default as an example "10 seconds till the end of the world" //countdownCompleteMsg is what appears when every thing hits 0, default is "Timer has completed". [/js] I may rework it and have separate options for hour/min/sec rather than split them, and clean it up a little and possibly have an option for transitions (fadeIn/Out etc). It has the ability to have different counters, and also the same counter in different places (by adding the same classed element in different places);
  3. http://shop.browsergamesfactory.com/
  4. Of course, any DOM element can be given the ability of dragging/dropping.
  5. The only legal way to get MCCodes is from MCCodes.
  6. No license, it's not legal period. Try MCCodes Lite if you do not wish to pay, or buy a license via MCCodes.
  7. I'd advise you against using canvas especially something such as a gradient. Canvas is heavy on your CPU, so in this case you can use CSS3 gradients. What about html5 markup?
  8. Danny, it wouldn't work well with val() the way Dave is doing it. Okay so for multiple timers we can do it like this; [js] $(document).ready (function () { $('.clock').each(function () { var clock = $(this); setInterval(function () { var m = $('.min', clock), s = $('.sec', clock); if (m.length == 0 && parseInt(s.html()) <= 0) clock.html('Timer Complete.'); if (parseInt(s.html()) <= 0) { m.html(parseInt(m.html() - 1)); s.html(60); } if (parseInt(m.html()) <= 0) clock.html('<span class="sec">59</span> seconds.'); s.html(parseInt(s.html() -1)); }, 1000); }); }); [/js] HTML would be something along the lines of; <p class="clock"> <span class="min">7</span> minutes and <span class="sec">30</span> seconds </p> <p class="clock"> <span class="min">3</span> minutes and <span class="sec">20</span> seconds </p> Bah code tags really don't like my 'tab' tabbing but meh.
  9. What exactly is HTML5 inspired (not sure that's the right word to be honest), other than what I presume to be the keygen.
  10. No problem.
  11. jQuery: Ease of use, availability, tutorials whilst learning, range of valuable plugins. Use it for most my Ajax, JSON parsing amongst other things. YUI: YQL Queries; JSONp; HTML5 Video. I mainly use/like this due to using YQL often. MooTools; This I don't really use this, although I have in the past for form validation mainly. I enjoyed when I started using it, but then I found jQuery and MooTools hasn't had a look in since. Modernizr; I use this library for detection of HTML5/CSS3 feature availability, found to be rather useful. Finally, not really either but useful; HTML5shiv by Remy Sharp, very handy for HTML5 and IE. *Note under YUI, most are modules what I use but yeah, they are my reasons :D
  12. Stable. So that when you join, you don't have people with ridiculous stats/money/etc that you cannot compete with.
  13. Then what are you after? It teaches you how to create equal column height, ie one section stretches with content so do the rest, which is what you want judging from the first post The height query, min-height: 500px; sort of thing.
  14. If you just copied and pasted the divs in "<div id="welcomeMessage" class="popup_block">" - close it. (my bad)
  15. Bah, um lemme test it.
  16. Thanks Paddy. You too Alain. :)
  17. Did you add somewhere on the viewuser.php for it to show?
  18. $db->query('INSERT INTO `mail` ( `mail_to`, `mail_from`, `mail_time`, `mail_subject`, `mail_text` ) VALUES ( '.$i.', 2, UNIX_TIMESTAMP(), "'.$db->escape($subject).'", "'.$db->escape($mail).'")');
  19. I'm thinking its supposed to, due to the overlay of black. When the popup is closed does your content come back again?
  20. This isn't correct, take note of "The problem occurs when I try to install it on xampp on this bloody win 7 - I get the following." Xampp has display errors on by default, load any version of MCC lite/v1/v2 on Xampp, Wamp, Mamp etc you will get undefined notices everywhere, maybe someone should use isset() accordingly. The HTTP_X_FORWARDED_FOR was last in V2.01/ (two patches ago). Does there happen to be a $_GET['pad'] or $_REQUEST['pad'] in there? Anyway the solution, turn off display errors in Xampp (under PHP settings or PHP ini), or upload it to your normal web server/hosting and you won't see those undefined index notices.
  21. http://www.smashingmagazine.com/2010/11/08/equal-height-columns-using-borders-and-negative-margins-with-css/
  22. You'll need to change the isset ($_GET['yup']) to what's needed. Basically, create an empty div (or put content in the one that's wanted to popup) then only add the class if it's their first run. The js will check if the div#welcomeMessage has the class of popup_block if so it will continue with the popup. The only relevent bits are the php/div/css/js the other html is just there from a C+P job. <!doctype html> <html class="no-js" lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="author" content=""> <!--<link rel="shortcut icon" href="/favicon.ico"> <link rel="apple-touch-icon" href="/apple-touch-icon.png">--> <link rel="stylesheet" href="css/style.css?v=2"> </head> <body> <?php if (isset ($_GET['yup']) ) { echo '<div id="welcomeMessage" class="popup_block">'; } else { echo '<div id="welcomeMessage">NO POP UP</div>'; } ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script> <script> if ( $('#welcomeMessage').hasClass('popup_block')) { var width = 500, con = $('#welcomeMessage'); con.text('Some welcome message goes here'); $(con).fadeIn().css({ 'width:': width }).prepend('[url="#"][img=close_pop.png][/url]'); var popMargTop = ($(con).height() + 80) / 2, popMargLeft = ($(con).width() + 80) / 2; $(con).css({ 'margin-top': -popMargTop, 'margin-left': -popMargLeft }); $('body').append('<div id="fade"></div>'); $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); $('a.close, #fade').live('click', function() { //When clicking on the close or fade layer... $('#fade , .popup_block').fadeOut(function() { $('#fade, a.close').remove(); //fade them both out }); }); } </script> </body> </html> [css]#fade { /*--Transparent background layer--*/ display: none; /*--hidden by default--*/ background: #000; position: fixed; left: 0; top: 0; width: 100%; height: 100%; opacity: .80; z-index: 9999; } .popup_block{ display: none; /*--hidden by default--*/ background: #fff; padding: 20px; border: 20px solid #ddd; float: left; font-size: 1.2em; position: fixed; top: 50%; left: 50%; z-index: 99999; /*--CSS3 Box Shadows--*/ -webkit-box-shadow: 0px 0px 20px #000; -moz-box-shadow: 0px 0px 20px #000; box-shadow: 0px 0px 20px #000; /*--CSS3 Rounded Corners--*/ -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; } img.btn_close { float: right; margin: -55px -55px 0 0; } /*--Making IE6 Understand Fixed Positioning--*/ *html #fade { position: absolute; } *html .popup_block { position: absolute; }[/css] All of it belongs to that tutorial posted above, just changed bits around. Have fun. Note: Just a quick two minute job, could have been done more efficiently but that's for you to play with, this works but you can make it better if you wish to do so.
  23. It's because well, MCC v2.02 isn't exactly up-to date. The above 'error' isn't actually an error, just a notice. The script will run as expected, for the most part, the only downfall is that annoying message. You are able to turn of those notices either via the script itself or your php.ini file. Note: MCC v2.03 is the same in most places.
  24. I do miss the old days of FF, the WinXP style look to it.
  25. The code; mysql_* is somewhat outdated now.
×
×
  • Create New...