-4
oscommerceスクリプトで検索候補関数を統合していますが、関数は正常に動作していますが、div hide onclickを作成してjqueryスピード)私はdiv要素の入力を開始するとき以来は表示されますが、非表示にすることができません(私はその検索を削除するには、Webページをリフレッシュしてきたイベントは、このdivの下に作成されますのdiv)div onclickを非表示にしてjcleryを使用してonclickを表示する方法
をお勧め:
ここで私は添付するコード:
$data = '<div class="search">' . "\n" .
tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'id="frmSearch"') . "\n" . // ' <label class="fl_left">'.MODULE_BOXES_SEARCH_HEADER_BOX_TITLE.': </label>' ."\n".
' ' . tep_draw_button_search_top() . tep_draw_button(MODULE_BOXES_SEARCH_HEADER_BOX_TITLE) . tep_draw_button_search_bottom() . "\n" .
' <div class="input-width">' . "\n" .
' <div class="width-setter">' . "\n" .
tep_draw_input_field('keywords', MODULE_BOXES_SEARCH_HEADER_BOX_INPUT, 'id="txtSearch" onkeyup="searchSuggest(event);" autocomplete="off" size="10" maxlength="300" class="go fl_left" onblur="if(this.value==\'\') this.value=\'' . MODULE_BOXES_SEARCH_HEADER_BOX_INPUT . '\'" onfocus="if(this.value ==\'' . MODULE_BOXES_SEARCH_HEADER_BOX_INPUT . '\') this.value=\'\'"') . '' . tep_hide_session_id() . "\n" .
' </div>' . "\n" .
' <div id="smartsuggest" ></div> ' .
' </div>' . "\n" . '</form>' . "\n" .
'</div>
<script type="text/javascript">
$(function(){
var mq = window.matchMedia("(max-width: 480px)");
if((mq.matches)) {
$(".input-width").click(function() {
$(this).animate({right: "0", width: "125px"}, 500);
});
$(".input-width input").blur(function(){
$(this).parent().parent().animate({right: "0", width: "125px"}, 500);
});
}else{
$(".input-width").click(function() {
$(this).animate({right: "0", width: "360px"}, 500);
});
$(".input-width input").blur(function(){
$(this).parent().parent().animate({right: "0", width: "190px"}, 500);
});
}
});
</script>
' . "\n";
// MOD: BOF - SmartSuggest
if (SMARTSUGGEST_ENABLED != 'false') {
require(DIR_WS_CLASSES . 'smartsuggest.php');
$smartsuggest = new smartsuggest();
$smartsuggest->output($data);
}
// MOD: EOF - SmartSuggest
私はあなたのコードがより良いフォーマットするべきだと思います。私はそのコードを読むことができません。 –