Hello everyone. Sincerely, I hope to comment on topics.
Blog of Michael Chang

As floating post a message on my blog

Hello, we often see on multiple blogs that show us whether floating message to subscribe, to welcome us to your blog or some other useful reason. This time we do that, we will float a message which will be shown when a visitor enters our blog. To the Point:

1. Downloaded jquery which once downloaded you leave the name jquery.js

2. Jquery.js climbed inside the folder of the theme we're using.

3. We opened our header.php file (the one in our theme) and after the <head> wrote:

  <Script src = "<? Php bloginfo ('template_url');?> / Jquery.js" type = "text / javascript"> </ script>
 <script type="text/javascript">
	 jQuery (document). ready (function ($) (
	 $ (Window). Scroll (function () (
  		 $ ('# Message_box'). Animate ((top: $ (window). ScrollTop () + "px"), (queue: false, duration: 350));
	 ));

	 $ ('# Close_message'). Click (function () (
		 $ ('# Message_box'). Animate ((top: "+ = 15px", opacity: 0), "slow");
	 ));
		 jQuery (function () (
			 jQuery ('ul.sf-menu'). Superfish ();
		 ));
	 ));
 </ Script>

4. We open our file style.css and finally put the following code:

  # Message_box (
 position: absolute;
 top: 0; left: 0;
 z-index: 10;
 background: # ffc;
 padding: 5px;
 border: 1px solid # CCCCCC;
 text-align: center;
 font-weight: bold;
 width: 99%;
 )

5. Abrimons header.php file again and just after the <head> place:

  <div id="message_box">
     <img /> id="close_message" style="float:right;cursor:pointer" src="cualquierimagen.png"
 Our message.
 </ Div>

That's all folks, it is very difficult to do, if you have any questions or suggestions you can comment. Regards

Share |

Show the number of your followers on Twitter

Twitter like Facebook have had great acceptance in recent months. In this case we have a way to put in our blog the number of your Twitter followers.

The code contained herein is embedded within a text witget.

  <? Php
 $ Twit = file_get_contents ('http://twitter.com/users/show/USERNAME.xml');
 $ Begin = '<followers_count>', $ end = '</ followers_count>';
 $ Page = $ twit;
 $ Parts = explode ($ begin, $ page);
 $ Page = $ parts [1];
 $ Parts = explode ($ end, $ page);
 $ Tcount = $ parts [0];
 if ($ tcount =='') ($ tcount = '0 ';)
 echo '<div> <strong>'. $ tcount. "  </ Strong> Followers </ div> ';
 ?>

Just replace USERNAME with the user himself and ready. Have fun.

Truco seen WPtricks

Share |

Pack of free css menus


What about kids. Good sailing a little here and there I met a super pack of menus in css of various types. The truth is very good as are the samples of the menus of several pages such as Adobe, MTV, Nvidia, Vimeo, etc.. It is well worth downloading and above all make a donation to the programmers who did.

You can download the pack from HERE

Share |

Handling keyboard shortcuts javascript

Hello such, navigating a little OpenJS I found a great and valuable library: Shortcut.js . This library allows us to handle keyboard shortcuts (Ctrl + C) or the special keys like the F's in our web applications : D ...

Some might question. For what good would a library like this?. Easy, when sometimes we are making an application in which we need when the user presses this key or key combination that sends to execute a predefined function. At the moment I'm trying it and really is very easy to use. There are doing little explanation.

  • Link within the file <head> the document where you use:

src="js/shortcuts.js" <script type="text/javascript"> </ script>

  • Everything now head right there in defining our keys or key combinations:

<script type="text/javascript">
function init () (
shortcut.add ("F1", function () (
alert ("Press F1");
));

shortcut.add ("Ctrl + Shift + X", function () (
alert ("Press the combination: Ctrl + Shift + X");
));

)
window.onload = init;
</ Script>

There we see that we can use both keys and key combinations, can use the following:

  • alphanumeric: abc ... xyz, 01 .. 89
  • Tab
  • Space
  • Return
  • Enter
  • Backspace
  • Scroll_lock
  • Caps_lock
  • Num_lock
  • Pause
  • Insert
  • Home
  • Delete
  • End
  • Page_up
  • Page_down
  • Left
  • Up
  • Right
  • Down
  • F1
  • F2
  • F3
  • F4
  • F5
  • F6
  • F7
  • F8
  • F9
  • F10
  • F11
  • F12

For more information please visit the website of the project from OpenJS . That will be helpful : P

Share |