2014年2月20日木曜日

Adobe MuseにjQueryプラグインを読み込む方法

How to add jQuery Slideshow to Adobe Muse and Business Catalyst website | jQuery Slider, WordPress Slideshow, jQuery Video Gallery

In Abode Muse, click menu Page -> Page Properties, then click Metadata tag, add the following codes to the HTML for <head> box. You need to replace “yourwebsite.com” with your own domain name.
Adobe Muse jQuery Slideshow
<script language="JavaScript">
  function insertToHead(src) {
    var head = document.getElementsByTagName("head")[0];
    var script = document.createElement('script');
    script.setAttribute('type', 'text/javascript');
    script.setAttribute('src', src);
    head.appendChild(script);
  };
  var jQueryLoaded = setInterval(function(){
    if (jQuery)
    {
      clearInterval(jQueryLoaded);
      insertToHead('http://yourwebsite.com/myslider/amazingslider.js');
    }
  }, 500);
  var AmazingSliderLoaded = setInterval(function(){
    if (jQuery.fn.amazingslider)
    {
      clearInterval(AmazingSliderLoaded);
      insertToHead('http://yourwebsite.com/myslider/initslider-1.js');
    }
  }, 500);
</script>

2014年2月19日水曜日

リンクを選択した時のフォーカス枠を消すWEB制作(html,css(スタイルシート) )|プログラムメモ

リンクを選択した時のフォーカス枠を消すWEB制作(html,css(スタイルシート) )|プログラムメモ

リンクを選択した時のフォーカス枠(IEだと点線、Safariだと水色、Chromeだと茶色)を消したい時があります。
CSSだと
 a { outline: none; }
#hoge {
    overflow : hidden;
    outline : none;
}
outline というプロパティがありますが、これでは消えない時があります。
そんな時は

JavaScript

<a> タグにonfocus="this.blur();"を追加する。
例:
<a href="hoge.html" onfocus="this.blur();" >

2014年2月18日火曜日

iOSでonloadが効かない件

Mobile Safariでhistory.back時にloadイベントを発行したい時は、onpageshowを使うといいらしい
 
window.onpageshow = function() {
    alert("pageshow:ページを表示しました");
}

window.onpagehide = function() {
    alert("pagehide:ページから離脱しました");
}