thinkphpÔõôËø¶¨´¥Ãþ
Ëæ×ÅÒƶ¯»¥ÁªÍøµÄÉú³¤£¬Ô½À´Ô½¶àµÄÍøÕ¾ÐèÒªÊÊÅäÊÖ»ú¶Ë£¬ÊµÏÖÏìӦʽ½á¹¹¡£ÔÚÕâ¸öÀú³ÌÖУ¬´¥ÃþÊÂÎñµÄ´¦Àí³ÉΪÁËÒ»¸ö±Ø²»¿ÉÉٵĻ·½Ú¡£¶øÔÚthinkphp¿ª·¢ÖУ¬ÔõÑùËø¶¨´¥ÃþÔòÊǸ÷È˽ÏÁ¿¹Ø×¢µÄÎÊÌâ¡£
Ò»¡¢Ê²Ã´ÊÇ´¥ÃþÊÂÎñ£¿
´¥ÃþÊÂÎñÊÇÖ¸Óû§Í¨¹ý´¥ÃþÊÖ»úÆÁÄ»¾ÙÐвÙ×÷µÄÐÐΪ¡£ÀýÈçÇá´¥¡¢»¬¶¯¡¢³¤°´µÈ²Ù×÷¡£
ÔÚWEB¿ª·¢ÖУ¬´¥ÃþÊÂÎñÒ²ÐèÒª±»´¦Àí£¬ÒÔʵÏÖÓëÓû§µÄ½»»¥¡£ºÃ±ÈÓû§Çá´¥Ò»¸ö°´Å¥£¬»á´¥·¢ÏìÓ¦µÄ²Ù×÷¡£
¶þ¡¢ThinkPHPÈçÄÇÀïÖô¥ÃþÊÂÎñ£¿
Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»
ÔÚThinkPHPÖУ¬´¦Àí´¥ÃþÊÂÎñµÄ·½·¨Óë´¦ÀíÆäËûÊÂÎñµÄ·½·¨ÏàËÆ¡£Í¨¹ýÔÚÊÓͼÉÏʹÓÃJavaScriptÀ´²¶»ñ´¥ÃþÊÂÎñ£¬È»ºóÏòЧÀÍÆ÷·¢ËÍÇëÇó¾ÙÐд¦Àí¡£
ÏÂÃæÊÇÒ»¸ö¼òÆÓµÄÀý×Ó£¬Í¨¹ýʹÓÃjQueryÀ´²¶»ñ´¥ÃþÊÂÎñ£º
<script> $('#button').on('touchstart', function(e){ e.preventDefault();//×èֹĬÈÏÐÐΪ var id = $(this).attr('data-id');//»ñÈ¡°´Å¥ID $.ajax({ url:'´¦Àí´¥ÃþÊÂÎñµÄµØµã',//´¦Àí´¥ÃþÊÂÎñµÄµØµã type:'POST', data:{'id':id},//ת´ï²ÎÊý success:function(data){ //´¦Àí·µ»ØЧ¹û } }); }); </script>
µÇ¼ºó¸´ÖÆ
ÒÔÉÏ´úÂëÖУ¬Ê¹ÓÃÁËjQueryµÄtouchstartÊÂÎñ²¶»ñÁË°´Å¥µÄÇá´¥ÊÂÎñ£¬²¢Í¨¹ýAjaxÏòЧÀÍÆ÷·¢ËÍÁËÇëÇó¡£ÔÚЧÀÍÆ÷¶Ë£¬ÎÒÃÇÐèÒª±àдÏìÓ¦µÄ´¦Àí´úÂëÀ´ÏìÓ¦Õâ¸öÇëÇó¡£
Èý¡¢ÔõÑùËø¶¨´¥Ãþ£¿
ÓÉÓÚ´¥ÃþÊÂÎñÊÇÓû§×Ô¶¯ÐÐΪµÄ·´Ï죬ÈôÊÇÓû§ÆµÈԵؾÙÐвÙ×÷£¬¿ÉÄܻᵼÖÂϵͳÏìÓ¦»ºÂý»òÍ߽⡣Òò´Ë£¬ÓÐʱ¼äÐèÒªËø¶¨Ä³¸öÇøÓòµÄ´¥Ãþ£¬ÏÞÖÆÓû§µÄ²Ù×÷¹æÄ£¡£
ÔÚThinkPHPÖУ¬ÎÒÃÇ¿ÉÒÔͨ¹ýCSSÑùʽÀ´Ëø¶¨´¥ÃþÊÂÎñ¡£Í¨¹ý¶Ôij¸öÔªËØÌí¼ÓÑùʽpointer-events:none£¬¾Í¿ÉÒÔեȡ¸ÃÔªËØÎüÊÕ´¥ÃþÊÂÎñ¡£ÀýÈçÒÔÏ´úÂ룺
<div>¸ÃÇøÓò±»Ëø¶¨£¬²»¿É´¥Ãþ</div>
µÇ¼ºó¸´ÖÆ
ÒÔÉÏ´úÂëÖУ¬boxÀàµÄdivÔªËØÌí¼ÓÁËÑùʽpointer-events:none£¬¸ÃÔªËØÎÞ·¨ÏìÓ¦´¥ÃþÊÂÎñ¡£
ËÄ¡¢×ܽá
ÒÔÉϾÍÊǹØÓÚÈçÄÇÀïÖô¥ÃþÊÂÎñÒÔ¼°ÔõÑùËø¶¨´¥ÃþµÄÏÈÈÝ¡£ÔÚÍøÕ¾¿ª·¢ÖУ¬´¥ÃþÊÂÎñµÄ´¦ÀíÊDz»¿É×èÖ¹µÄ£¬ÐèҪƾ֤ÏêϸÐèÇóÑ¡Ôñ¶ÔÓ¦µÄÊÖÒռƻ®¡£Í¬Ê±£¬ÎªÁËÌá¸ßÓû§ÌåÑéºÍ°ü¹ÜϵͳÎȹ̣¬Êʵ±µÄËø¶¨´¥Ãþ²Ù×÷Ò²ÊǺÜÓÐÐëÒªµÄ¡£
ÒÔÉϾÍÊÇthinkphpÔõôËø¶¨´¥ÃþµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡