Google can be said to be the fullest special effects of ajax, such as google suggest, google map, igoogle draggable window, etc... Today we are going to create a website similar effect, and we have made a simple demo based on iGoogle.
This demo is made directly based on a Jquery framework: easywidgets. This framework is available for free download /project/easywidgets.
I won’t say much nonsense, just post the source code for everyone to learn!
html
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" media="screen" href="css/" rel="external nofollow" rel="external nofollow" mce_href="css/" rel="external nofollow" rel="external nofollow" /> <script type="text/javascript" src="js/"></script>
<script type="text/javascript" src="js/"></script>
<script type="text/javascript" src="js/"></script>
<script src="js/" type="text/javascript"></script>
</head> <body> <!--left--> <div class="widget-place column1"> <div class="widget movable"> <div class="widget-header"><strong>drar me</strong> </div> <div class="widget-content">left-----Drag with the mouse</div> </div> <div class="widget movable"> <div class="widget-header"><strong>drar me</strong> </div> <div class="widget-content">left-----Drag with the mouse</div> </div> <div class="widget movable"> <div class="widget-header"><strong>drar me</strong> </div> <div class="widget-content">left-----Drag with the mouse</div> </div> </div> <!--middle--> <div class="widget-place column2"> <div class="widget movable collapsable removable editable"> <div class="widget-header"><strong>drar me</strong> </div> <div class="widget-editbox" style="background:#CC6699" mce_style="background:#CC6699">This is the content of the editing. In order to be conspicuous, I added a background</div><div class="widget-content">middle------Drag with the mouse</div> </div> <div class="widget movable removable editable"> <div class="widget-header"><strong>drar me</strong> </div> <div class="widget-content">middle------Drag with the mouse</div> </div> <div class="widget movable removable editable"> <div class="widget-header"><strong>drar me</strong> </div> <div class="widget-content">middle------Drag with the mouse</div> </div> </div> <!--right--> <div class="widget-place column3"> <div class="widget movable"> <div class="widget-header"><strong>drar me</strong> </div> <div class="widget-content">right------Drag with the mouse</div> </div> <div class="widget movable"> <div class="widget-header"><strong>drar me</strong> </div> <div class="widget-content">right------Drag with the mouse</div> </div> <div class="widget movable"> <div class="widget-header"><strong>drar me</strong> </div> <div class="widget-content">right------Drag with the mouse</div> </div> </div> </body> </html>
CSS
body{ margin: 0; padding: 0; background-color: silver; font-family: 'Lucida Grande','Lucida Sans Unicode','Song style','New Song',arial,verdana,sans-serif; color: #666; font-size:20px; line-height:150%; } #left{ width: 380px; height: 100%; padding: 10px; position: absolute; top: 10px; left: 10px; border: solid red 2px; } #left .widget { width: 340px; height: 150px; padding; 10px; margin: 20px; border: solid red 2px; background-color: white; } #left .widget .widget-header { width: 340px; height: 30px; padding: 0; margin: 0; color: red; position: static; background-color: gray; } #middle{ width: 400px; height: 100%; position: absolute; top:10px; left: 435px; padding: 10px; margin: 0 30px 0; border: solid red 2px; } #middle .widget { width: 360px; height: 150px; padding; 10px; margin: 20px; border: solid red 2px; background-color: white; } #middle .widget .widget-header { width: 360px; height: 30px; padding: 0; margin: 0; color: red; position: static; background-color: gray; } #right{ width: 380px; height: 100%; padding: 10px; position: absolute; top: 10px; right: 10px; border: solid red 2px; } #right .widget { width: 340px; height: 150px; padding; 10px; margin: 20px; border: solid red 2px; background-color: white; } #right .widget .widget-header { width: 340px; height: 30px; padding: 0; margin: 0; color: red; position: static; background-color: gray; }
javascript code
$(document).ready(function(){ $.({ i18n : { editText : 'edit', closeText : 'closure', extendText : 'Expand', collapseText : 'fold', cancelEditText : 'Cancel' } }); });