通常、設計・デザインの段階であらかじめ表示する文字数の上限を決めておき、PHPやRuby、Javaなどサーバサイドで表示する文字列を加工することが多いかと思います。 しかし、この方法だと動的に変化する領域を基準に表示する文字数を制限する場合や、文字サイズや表示領域のサイズに合わせて上限を算出する場合に限界があります。 そこで、クライアントサイドで表示領域から文字列がはみ出す場合、文字列を省略して省略記号「…」をつける方法を紹介してみたいと思います。 実現方法として以下の2つの方法があります。 text-overflowプロパティを使う jQueryで表示領域の幅・高さに合わせて文字列を加工する text-overflowプロパティを使う text-overflowプロパティを用いると、文字列が表示領域からはみ出してしまった場合、はみ出した文字列を省略記号「…」で省略することができます。 尚
Rounded Animated Navigation An experimental full-screen navigation, animated using CSS and jQuery, that expands within a circle. I was checking out the new Ping iOS app. The effect when you tap on the circle to switch the page is too cool, so I tried to create something similar in CSS and jQuery. The result is pretty cool, hence we decided to release the snippet here on CodyHouse :) It's an experi
DigitalOcean provides cloud products for every stage of your journey. Get started with $200 in free credit! A reader sent me in a GIF showing off a cool effect they saw on Google on mobile. (Presumably the homepage you see when you launch Chrome on Android?) There is a search input in the middle of the page that scrolls with the page, but as it’s about to scroll off the page, it becomes affixed to
Slide In Panel A CSS3 and JavaScript powered slide-in panel, to quickly show side content, notifications or profile information. There will be cases when you need to display side content (a notification, a user profile information...), and this content doesn't fit into a tooltip. You may create a new page and link to it, but, when possible, it's wise to avoid a page refresh. In these cases a panel
Points Of Interest Use this resource to highlight the points of interest of your products. Just a click to open a brief description of each point, allowing your user to get a deep and fast understanding of your product features. Let's say you want to showcase the best features of your new app, and you want users to learn what your app is capable of right from the design screens. A possible approac
Secondary Fixed Navigation A secondary navigation intended for users who want a quick overview of the page content, and be able to easily move from one section of the page to the other. A fixed navigation with smooth, jQuery powered scroll. Nothing fancy here, yet a handy snippet for creating a secondary menu to quickly surf through the page content. We see this effect a lot these days, a good exa
CSS animations (and a little JavaScript trickery) can let us add page transitions and move away from the hard-cut of page loads. My jQuery plugin smoothState.js helps polish those transitions and improve UI response times. Page transitions benefit the user experience Imagine, for a second, how disorienting it would be if touching a doorknob teleported you to the other side of the door. Navigating
WordPressでテーマを作る場合、Javascriptや外部CSSを使うことも多いと思いますが、テーマのheader.phpに直接書くのではなく、functions.phpから一括で管理する方法です。 WordPressでは、キューに追加されたJavascriptやCSSを wp_head() や wp_footer() の位置で、自動的に適切な順番で出力してくれます。特にjQueryなどのライブラリやjQueryプラグインを使用する場合は、複数のjsファイルに依存関係が発生し、読み込む順番が決まってくる場合があります。こういう時でも、一括管理していればあとあとで変更が楽になります。こんな感じ。 /** * スクリプトとスタイルをキューに入れる */ function my_scripts() { // 管理画面では読み込まない if ( !is_admin() ) { // スタイル
Author’s note: the most recent version, 1.3, is published on January 4th, 2014. I love writing on Medium. The typography is nothing short of fantastic. The editor is simple, minimalist and distraction-free. The handling of images is perfectly done. The last point has especially piqued my interest. I adore the smooth transition offered by Medium’s lightbox module — no disruptive modal window, and o
Bento will never post information on your behalf without your permission first. By signing in and using this site, you agree to our privacy terms. Learn to code for free We curated the best tutorials from around web and created a free full stack web development curriculum by top engineers. See our free learning tracks 100+ web development topics Stop searching for the right tutorial for a specific
We’ve all used jQuery’s animate() to create nice effects on our web pages. Then, with the introduction and the rise of CSS3 they told us that our code was rubbish. They suggested that we dump all of our jQuery-based animations (and in general JavaScript-based animations) in favor of CSS-based ones. This change forced us to deal with a lot of browser (in)compatibility issues and lack of features; n
先日の「スクロールやクリックした際に、おおっ!と思わせるクリエイティブな7つのエフェクト」はかなりインパクトがありましたが、今回紹介するのは非常に繊細なスクロールエフェクトです。 使用するのはよく見かけるレイアウトで、上部からヘッダ、ナビゲーション、打ち出し、コンテンツと積み重ねたものです。 Scrolling Banner スクロールすると、コンテンツは通常通りスクロールされ、画像はパララックスで少し遅れて、カーテンをあげるような感じになっています。 他の要素も上部に上がりながら、フェードで消えていきます。 少しスクロールしたキャプチャ コンテンツの表示ということに関しては、普通のスクロール操作と同じですが、ほんのちょっとエフェクトを加えるだけで印象がだいぶ変わりますね。 小さいと分かりにくいと思いますが、アニメーションgifにしてみました。 Scrolling Banner コードの主
この記事のすぐ上をご覧いただければお分かりのように、弊社ブログのソーシャルボタンは従来のそれではなく、独自のデザインにカスタマイズされています。少ない手順でオフィシャルのソーシャルボタンを設置するのもお手軽でいいですが、もう一手間加えて独自のデザインにカスタマイズし、ページ全体の統一感を一段上に持っていくためのノウハウを知っておいて損はありません *1。 ※ 予備知識オフィシャルのツイートボタン設置方法 Twitter オフィシャルサイトの開発者向けページに詳しい手順が載っているので、それに従って進めていけば殆どコピペだけで設置することが出来ます。 Tweet Button | Twitter Developers html <a href="https://twitter.com/share" class="twitter-share-button" data-url="https://
Webの矛盾についての考察、TLSのパフォーマンス最適化Tips、jQueryの未来に対する提言など海外WEBテク20本を一挙公開 斉藤 祐也(株式会社リッチメディア) 斉藤祐也の海外WEBテク定点観測<Issue.11: 2014/02/01-2014/02/28> 今月の定点観測は、Webが持つある1つの矛盾についての考察、TLSのパフォーマンス最適化Tips、jQueryの未来に対する提言などを紹介します。 注目ニュースピックアップ Webに課せられたある1つの矛盾についての考察 – Adactio 原題: Continuum 常に進化を続けるWebと、常に停滞しているWebは表裏一体の存在です。その矛盾が存在する理由はブラウザです。新しいCSS、新しいJavaScriptの仕様が、すべてのブラウザで利用できるということはもちろんありません。 Jeremy Keith氏は、この記事で
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く