HTML5¼¼Êõ

AmazeUI(ÃÃ×ÓUI)ÖÐCSS×é¼þ¡¢JS²å¼þ¡¢Web×é¼þµÄÇø±ð - ³¤É³Óθç

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-08-01 09:00 ÎÒÒªÆÀÂÛ( )

AmazeUI(ÃÃ×ÓUI)ÊǷdz£ÓÅÐãµÄ¹ú²úÇ°¶ËUI£¬ÏÖÔÚÀ´½éÉÜÒ»ÏÂAmazeUIÖÐCSS×é¼þ¡¢JS²å¼þÓëWeb×é¼þµÄÇø±ð¡£ CSS×é¼þ¹ËÃû˼Òå¾ÍÊǽöʹÓÃCSSäÖȾ¶ø³ÉµÄ×é¼þ£¬¶øJS²å¼þÒ²ºÜÈÝÒ×Àí½â£¬¾ÍÊÇÓÉCSSäÖȾºÍJSÀ´¿ØÖÆÐÐΪµÄ×é¼þ¡£ ±È½Ï²»ºÃÀí½â¾ÍÊÇWeb×é¼þ£¬ºÃÏñ¸úJS²å¼þÒâ˼

AmazeUI(ÃÃ×ÓUI)ÊǷdz£ÓÅÐãµÄ¹ú²úÇ°¶ËUI£¬ÏÖÔÚÀ´½éÉÜÒ»ÏÂAmazeUIÖÐCSS×é¼þ¡¢JS²å¼þÓëWeb×é¼þµÄÇø±ð¡£ 
CSS×é¼þ¹ËÃû˼Òå¾ÍÊǽöʹÓÃCSSäÖȾ¶ø³ÉµÄ×é¼þ£¬¶øJS²å¼þÒ²ºÜÈÝÒ×Àí½â£¬¾ÍÊÇÓÉCSSäÖȾºÍJSÀ´¿ØÖÆÐÐΪµÄ×é¼þ¡£
±È½Ï²»ºÃÀí½â¾ÍÊÇWeb×é¼þ£¬ºÃÏñ¸úJS²å¼þÒâ˼²î²»¶à£¬¶¼ÊÇCSSºÍJS×é³ÉµÄ¡£ËüÃǵ½µ×Çø±ðÔÚÄÄ£¿ÎÒÃÇÖصãÀ´½²Õâ¸ö¡£
ÎÒÃÇͨ¹ýѧϰÈçºÎµ÷ÓÃWeb×é¼þ£¨ÆäÖеÄÊÖ·çÇÙ×é¼þ£©À´Ò»²½Ò»²½Á˽âÆäÓëJS²å¼þµÄÇø±ð¡£

 

ʾÀý01.Web×é¼þ-Ö±½ÓʹÓà (ÇëÏÂÔظ½¼þ²é¿´Ê¾Àý)

ʾÀýÖйؼü´úÂ룺

 

ʾÀý02.Web×é¼þ-ͨ¹ýÄ£°åÀ´µ÷ÓÃ-ʾÀý1 (ÇëÏÂÔظ½¼þ²é¿´Ê¾Àý)

ʾÀýÖйؼü´úÂë1£¨ÒýÓà handlebars.js ºÍ ÃÃ×Óuiµ÷ÓÃhandlebars.jsµÄ¸¨Öújs£©£º

ʾÀýÖйؼü´úÂë2£¨¶¨ÒåÒ»¸öÄ£°å£©£¨»°ËµÕâ¸öÄ£°åҲûɶʵ¼ÊÒâÒ壬µ«¹Ù·½µÄdemo¾ÍÊÇÕâôдµÄ£¬ÎÒÖ»ÊÇÒÆÖ²ÁËһϣ©£º

accordion accordionData}}

ʾÀýÖйؼü´úÂë3£¨µ÷ÓÃJS´úÂëʹÆ乤×÷£©£º

template = Handlebars.compile($tpl.text()), html = template(data); $tpl.before(html); //ÏÔʾ½á¹û

 

ʾÀý03.Web×é¼þ-ͨ¹ýÄ£°åÀ´µ÷ÓÃ-ʾÀý2 (ÇëÏÂÔظ½¼þ²é¿´Ê¾Àý)

ʾÀýÖйؼü´úÂë1£¨ÒýÓàhandlebars.js ºÍ ÃÃ×Óuiµ÷ÓÃhandlebars.jsµÄ¸¨Öújs£©£º Í¬ÉÏ£¬ËùÒÔÊ¡ÂÔ...

ʾÀýÖйؼü´úÂë2£¨µ÷ÓÃJS´úÂëʹÆ乤×÷£©£º

html = template(data.accordionData); $("#div1").before(html); //ÏÔʾ½á¹û

 

ʾÀý04.Web×é¼þ-ͨ¹ý×Ô¶¨ÒåÄ£°åÀ´µ÷Óà(ÇëÏÂÔظ½¼þ²é¿´Ê¾Àý)

ʾÀýÖйؼü´úÂë1£¨ÒýÓàhandlebars.js £©

¡¡¡¡

¡¡¡¡²»Ò»ÑùµÄµØ·½ÔÚÓÚ£¬Õâ´ÎÖ»ÒýÓÃÁË handlebars.js £¬¶øûÓÐÒýÓàÃÃ×Óuiµ÷ÓÃhandlebars.jsµÄ¸¨Öújs £¬ÒòΪ²»ÐèÒªÁË¡£

 

ʾÀýÖйؼü´úÂë2£¨×Ô¶¨Òåԭʼģ°å£©£º

}}

ʾÀýÖйؼü´úÂë3£¨µ÷ÓÃJSʹÆ乤×÷£©£º

"content": [..Ê¡ÂÔ.., { 3 "title": "±êÌâ¶þ", 4 "content": "ÄÚÈݶþ", }, ..Ê¡ÂÔ..] 7 }; demoHtml = demoTemplate(demoData); $("#div1").html(demoHtml); //ÏÔʾ½á¹û

 

ʾÀý05.Web×é¼þ-»ªÈðÊÖ·çÇÙ×é¼þ (ÇëÏÂÔظ½¼þ²é¿´Ê¾Àý)

ʾÀýÖйؼü´úÂë1£¨huarui.accordion.helper.js£©£º

ÕâÊÇÒ»¸ö×Ô¶¨ÒåWeb×é¼þµÄjsÖ§³ÖÎļþ£¬Õâ¸öÎļþµÄ±àдºÜ¼òµ¥£¬¸´ÖÆ amazeui.widgets.helper.js ¸ÄÒ»¸Ä¾ÍºÃÁË¡£

hbs.registerPartial('hr-accordion', '\ 3 {{#this}}\ 4 <section data-am-widget="accordion" {{#if id}} {{/if}} data-am-accordion=\'{ {{#if options.multiple}}"multiple": true{{/if}} }\'>\ 5 {{#each content}}\ 6 <dl>\ 7 <dt>\ 8 <!-- Ìí¼Óͼ±êµÄ¹Ø¼ü´úÂë -->\ 9 {{#if icon}}<img src="{{icon}}" />{{/if}}\ 10 {{{title}}}\ 11 </dt>\ 12 <dd>\ 13 <div>\ 14 {{{content}}}\ 15 </div>\ 16 </dd>\ 17 </dl>\ 18 {{/each}}\ 19 </section>\ 20 {{/this}}');

ʾÀýÖйؼü´úÂë2£¨ÒýÓÃÏà¹ØjsÎļþ£©£º

ʾÀýÖйؼü´úÂë3£¨µ÷ÓÃJSʹÆ乤×÷£©£º

"content": [..ÂÔ.., { 3 "title": "±êÌâ¶þ", 4 "content": "ÄÚÈݶþ", }, ..ÂÔ..] 7 }; demoHtml = Handlebars.compile('{{>hr-accordion}}')(demoData); 10 $("#div1").html(demoHtml); //ÏÔʾ½á¹û

 

¿´ÍêÒÔÉϵÄʾÀý£¬µÃ³ö½áÂÛ£º

ÔÚAmazeUI£¨ÃÃ×ÓUI£©ÖУ¬Web×é¼þ¿ÉÒÔ²»±àдģ°å¶øÖ±½ÓʹÓã¬ÈôÈç´Ë£¬ÔòÓëJS²å¼þûʲô̫´óÇø±ð£¬¹Ù·½Ô­»°Ò²Ëµ¿ÉÒÔÕâôµ÷Óõġ£

Web×é¼þÓëJS²å¼þµÄ²»Í¬Ö®´¦ÔÚÓÚ£¬Web×é¼þ½èÖú handlebars.js ʵÏÖÁËÇ¿´óµÄÄ£°å¹¦ÄÜ£¬ÎÒÃÇÄܱàд×Ô¶¨ÒåÄ£°å´Ó¶øʹWeb×é¼þ¸ü¾ß¸öÐÔ£¬ÉõÖÁÊDZàд³öеÄWeb×é¼þ¡£

ÏÂÔظ½¼þ£ºAmazeUIµÄWeb×é¼þ.zip

 

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • JS×é¼þϵÁСª¡ª×Ô¼º¶¯ÊÖÀ©Õ¹BootstrapTableµÄ ¶³½áÁÐ ¹¦ÄÜ£º³¹µ×½â¾ö¸ß¶ÈÎÊÌâ - ÀÁµÃ°²·Ö

    JS×é¼þϵÁСª¡ª×Ô¼º¶¯ÊÖÀ©Õ¹BootstrapTableµÄ ¶³½áÁÐ ¹¦ÄÜ£º³¹µ×½â¾ö

    2017-07-01 11:03

  • ¼Ç¼һ´ÎÏßÉÏ×é¼þ±ÀÀ£µÄ½â¾ö¹ý³Ì - HarlanC

    ¼Ç¼һ´ÎÏßÉÏ×é¼þ±ÀÀ£µÄ½â¾ö¹ý³Ì - HarlanC

    2017-06-22 10:01

  • »ùÓÚVueÈ«¼ÒÍ°¿ª·¢µÄÇ°¶Ë×é¼þ¹ÜÀíƽ̨ - ÑÅX¹²ÉÍ

    »ùÓÚVueÈ«¼ÒÍ°¿ª·¢µÄÇ°¶Ë×é¼þ¹ÜÀíƽ̨ - ÑÅX¹²ÉÍ

    2017-06-15 08:00

  • Õâ 5 ¸öÇ°¶Ë×é¼þ¿â£¬¿ÉÒÔÈÃÄã·ÅÆú jQuery UI - ÆÏÌѳǿؼþ¼¼ÊõÍŶÓ

    Õâ 5 ¸öÇ°¶Ë×é¼þ¿â£¬¿ÉÒÔÈÃÄã·ÅÆú jQuery UI - ÆÏÌѳǿؼþ¼¼ÊõÍŶÓ

    2017-05-27 11:00

ÍøÓѵãÆÀ
Ç