housenav.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. $module = Yii::$app->hostserver->module['module'];
  3. ?>
  4. <!-- 导航 -->
  5. <div class="hu_nav" id="wdemo07">
  6. <div class="hu_nav_main scroller">
  7. <ul class="c clearfix">
  8. <li>
  9. <a href="/house/<?= $hid ?>">
  10. <span><?= \common\fm\Opencc::ConvertHn('楼盘首页') ?></span>
  11. <i></i>
  12. </a>
  13. </li>
  14. <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/details') > 0) echo 'class="on"' ?>>
  15. <a href="/house/details/<?= $hid ?>">
  16. <span><?= \common\fm\Opencc::ConvertHn('详情') ?></span>
  17. <i></i>
  18. </a>
  19. </li>
  20. <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/album') > 0) echo 'class="on"' ?>>
  21. <a href="/house/album/<?= $hid ?>">
  22. <span><?= \common\fm\Opencc::ConvertHn('相册') ?></span>
  23. <i></i>
  24. </a>
  25. </li>
  26. <li <?php if (strpos($_SERVER['REQUEST_URI'], 'house/type') > 0) echo 'class="on"' ?>>
  27. <a href="/house/type/<?= $hid ?>">
  28. <span><?= \common\fm\Opencc::ConvertHn('户型') ?></span>
  29. <i></i>
  30. </a>
  31. </li>
  32. </ul>
  33. </div>
  34. </div>
  35. <script>
  36. /**
  37. * 动态加载JS
  38. * url JS路径
  39. * callback 回调函数
  40. */
  41. function dynamicLoadJs(url, callback) {
  42. var head = document.getElementsByTagName('head')[0];
  43. var script = document.createElement('script');
  44. script.type = 'text/javascript';
  45. script.src = url;
  46. if (typeof (callback) == 'function') {
  47. script.onload = script.onreadystatechange = function () {
  48. if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") {
  49. callback();
  50. script.onload = script.onreadystatechange = null;
  51. }
  52. };
  53. }
  54. head.appendChild(script);
  55. }
  56. // 调用方法
  57. // dynamicLoadJs('/js/menu/lpnav.js',function(){});
  58. </script>