質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CSS3

CSS(Cascading Style Sheet)の第3版です。CSS3と略されることが多いです。色やデザインを柔軟に変更することが可能になります。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

jQuery

jQueryは、JavaScriptライブラリのひとつです。 簡単な記述で、JavaScriptコードを実行できるように設計されています。 2006年1月に、ジョン・レシグが発表しました。 jQueryは独特の記述法を用いており、機能のほとんどは「$関数」や「jQueryオブジェクト」のメソッドとして定義されています。

Q&A

解決済

2回答

4882閲覧

jQueryのcss3「keyframe」がブラウザsafari(PC,iPhone)のみcssを取得しない

退会済みユーザー

退会済みユーザー

総合スコア0

CSS3

CSS(Cascading Style Sheet)の第3版です。CSS3と略されることが多いです。色やデザインを柔軟に変更することが可能になります。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

jQuery

jQueryは、JavaScriptライブラリのひとつです。 簡単な記述で、JavaScriptコードを実行できるように設計されています。 2006年1月に、ジョン・レシグが発表しました。 jQueryは独特の記述法を用いており、機能のほとんどは「$関数」や「jQueryオブジェクト」のメソッドとして定義されています。

0グッド

0クリップ

投稿2016/02/19 22:44

編集2016/02/22 10:09

実現しないことは、以下のソースでfirefox、chrome、IEでは問題なく動作するのですが、
safari(PC,iphone)ではcssの取得がされません。

原因が分かる方、ご教授いただけますでしょうか。

keyframeは、別途cssに記載しております。

$(function () { $('.thumb-1').css({ 'animation': 'move1 25s ease-in-out -' + Math.random() * 25 + 's infinite alternate forwards running', '-webkit-animation': 'move1 25s ease-in-out -' + Math.random() * 25 + 's infinite alternate forwards running'}); });
.thumb-1{ position:absolute; top:-100px; left:-200px; }

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

ベストアンサー

$(function() {

$('.thumb-1').css({
'-webkit-animation-name':'move1',
'-webkit-animation-duration':'25s',
'-webkit-animation-timing-function':'ease-in-out',
'-webkit-animation-delay':' -' + Math.random() * 20 + 's ',
'-webkit-animation-iteration-count':'infinite',
'-webkit-animation-direction':'alternate',
'-webkit-animation-fill-mode':'forwards',
'-webkit-animation-play-state':'running',
'animation-name':'move1',
'animation-duration':'25s',
'animation-timing-function':'ease-in-out',
'animation-delay':' -' + Math.random() * 20 + 's ',
'animation-iteration-count':'infinite',
'animation-direction':'alternate',
'animation-fill-mode':'forwards',
'animation-play-state':'running'});

$('.thumb-2').css({
'-webkit-animation': 'move2 20s ease -' + Math.random() * 20 + 's infinite alternate forwards running',
'animation': 'move2 20s ease -' + Math.random() * 20 + 's infinite alternate forwards running'});

$('.thumb-3').css({
'-webkit-animation': 'move3 30s ease-in-out -' + Math.random() * 30 + 's infinite alternate forwards running',
'animation': 'move3 30s ease-in-out -' + Math.random() * 30 + 's infinite alternate forwards running'});

$('.thumb-4').css({
'-webkit-animation': 'move4 30s ease-in-out -' + Math.random() * 30 + 's infinite alternate forwards running',
'animation': 'move4 30s ease-in-out -' + Math.random() * 30 + 's infinite alternate forwards running'});

$('.thumb-5').css({
'-webkit-animation': 'move5 30s ease-in-out -' + Math.random() * 30 + 's infinite alternate forwards running',
'animation': 'move5 30s ease-in-out -' + Math.random() * 30 + 's infinite alternate forwards running'});

$('.thumb-6').css({
'-webkit-animation': 'move6 21s ease-in-out -' + Math.random() * 21 + 's infinite alternate forwards running',
'animation': 'move6 21s ease-in-out -' + Math.random() * 21 + 's infinite alternate forwards running'});

$('.thumb-7').css({
'-webkit-animation': 'move7 36s ease-in-out -' + Math.random() * 36 + 's infinite alternate forwards running',
'animation': 'move7 36s ease-in-out -' + Math.random() * 36 + 's infinite alternate forwards running'});

});

投稿2016/02/22 10:27

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

同様の質問で、「keyframesを0%から100%まで全て記述していないから動かない」という回答がされておりました。ご確認ください。(this won't work:とthis will:の部分)

投稿2016/02/21 09:29

編集2016/02/21 09:30
yamato_hikawa

総合スコア2092

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2016/02/21 09:37

ご回答いただきありがとうございます。 keyframesは、別途記述しているのですが、safariのみjsを読み込んでくれず、cssでのabsoluteの位置からkeyframeが開始してしまう状況でございます。 chrome、firefoxは問題なく動作しております。
退会済みユーザー

退会済みユーザー

2016/02/22 10:04 編集

jQueryでcssを付与する際に、プロパティを省略形で書くとsafariで付与されないという情報がありました。 その際に、省略形で記載せず、以下のように記載しましたが、jQueryのcssを取得されませんでした。 //move1 $(function () { return $('.thumb-1').css({ '-webkit-animation-name':'move1', '-webkit-animation-duration':'25s', '-webkit-animation-timing-function':'ease-in-out', '-webkit-animation-delay':' -' + Math.random() * 20 + 's ', '-webkit-animation-iteration-count':'infinite', '-webkit-animation-direction':'alternate', '-webkit-animation-fill-mode':'forwards', '-webkit-animation-play-state':'running', 'animation-name':'move1', 'animation-duration':'25s', 'animation-timing-function':'ease-in-out', 'animation-delay':' -' + Math.random() * 20 + 's ', 'animation-iteration-count':'infinite', 'animation-direction':'alternate', 'animation-fill-mode':'forwards', 'animation-play-state':'running' }); 記載にミスがあるか、ご教授いただけますでしょうか。 よろしくお願いします。
退会済みユーザー

退会済みユーザー

2016/02/22 10:26

すみません、上記でsafariでも無事解説いたしました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問