使用AJAX动态装箱
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用AJAX动态装箱相关的知识,希望对你有一定的参考价值。
This is how you can create page box elements that are loaded via AJAX and can be refreshed instantly without a whole page reload.
jQuery(document).ready(function($) { //event to show the box controls when the mouse hovers the box //applies to all elements with class="box" $('.box').mouseover(function(){ //replace string "box" with "controls" var dyn_var = "#" + this.id.replace("box","controls"); $(dyn_var).show(); }); //initialize box controls $('.box .controls').hide(); //hide all box controls //hide box when mouse exits box $('.box').mouseout(function(){ $('.box .controls').hide(); }); //load box content (loads after page loads) loadboxcontent('box-id1'); loadboxcontent('box-id2'); //etc... });
以上是关于使用AJAX动态装箱的主要内容,如果未能解决你的问题,请参考以下文章
html PHP代码片段: - AJAX基本示例:此代码演示了使用PHP和JavaScript实现的基本AJAX功能。