SlideShare a Scribd company logo
Presented by your friends atPresented by your friends at
Responsive JavascriptResponsive Javascript
in Drupal Sitesin Drupal Sites
About MeAbout Me
CEO of Trellon
on drupal.org@techsoldaten
Chief Internet Strategist
for Trellon
One of the first Drupal firms in North America
10+ years architecting large scale Drupal
environments
Passionate about scalability, third-party
integration, contributions
Responsive Javascript in Drupal Sites
Responsive JavascriptResponsive Javascript
Responsive Javascript in Drupal Sites
Scripts that run:
In specific browser dimensions
On devices with specific capabilities
Can be activated / removed in response to changes
in device dimensions, including rotation
There's No One WayThere's No One Way
Responsive Javascript in Drupal Sites
Popular solutions. Each has benefits and drawbacks:
jQuery Mobile
jQuery Factories
Conditional javascript with @media
Just using display: none and duplicating the markup
with a different selector
Why is This a DrupalWhy is This a Drupal
Problem?Problem?
Responsive Javascript in Drupal Sites
Drupal has a lot of things that don't respond well to mobile.
CKEditor: Try using this on mobile
Views Slideshow: No destroy method
Breakpoints: No integration outside theme
Recipe for ResponsiveRecipe for Responsive
JavascriptJavascript
Responsive Javascript in Drupal Sites
jRespond
Define breakpoints in theme
Views
Just views, no slideshows
jRespondjRespond
Allows you to set breakpoints
Responsive Javascript in Drupal Sites
<script>
// adds breakpoints used by javascript
var jRes = jRespond([
{
label: 'handheld',
enter: 0,
exit: 640
},{
label: 'tablet',
enter: 768,
exit: 979
},{
label: 'desktop',
enter: 1200,
exit: 10000
}
]);
</script>
jRespondjRespond
Allows you to set breakpoints
Responsive Javascript in Drupal Sites
<script>
jRes.addFunc({
breakpoint: 'handheld',
enter: function() {
// turns on slideshows
nav = showSlideshow('#slideshow');
},
});
function showSlideshow(item){
item.cycle();
}
</script>
Structured around functions
that fire when dimensions
change (instead of user
activity)
jRespondjRespond
Allows you to set breakpoints
Responsive Javascript in Drupal Sites
<script>
jRes.addFunc({
breakpoint: 'handheld',
enter: function() {
// turns on slideshows
nav = showSlideshow('#slideshow');
},
// here's my exit function
exit: function() {
// removes slideshows
'#slideshow'.cycle('destroy');
},
});
function showSlideshow(item){
item.cycle();
}
</script>
Code executes when users
enter and exit
Structured around functions
that fire when dimensions
change (instead of user
activity)
ViewsViews
Instead of using a Views plug in to generate something,
use responsive jQuery
Responsive Javascript in Drupal Sites
ExamplesExamples
Let's look at some sitesLet's look at some sites
Questions?
Thank you!
https://github.com/ten1seven/jRespond
heytrellon@trellon.com
twitter.com/trellon

More Related Content

Similar to Responsive Javascript

7 Redux challenges
7 Redux challenges7 Redux challenges
7 Redux challenges
reactima
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
Andrew Rota
 
Going Mobile First With Drupal
Going Mobile First With DrupalGoing Mobile First With Drupal
Going Mobile First With Drupal
Jesper Wøldiche
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
Chiew Carol
 
The ultimate guide to optimize your react native app performance in 2022
The ultimate guide to optimize your react native app performance in 2022The ultimate guide to optimize your react native app performance in 2022
The ultimate guide to optimize your react native app performance in 2022
Katy Slemon
 
Going web native
Going web nativeGoing web native
Going web native
Marcus Hellberg
 
The Modern Java Web Developer - JavaOne 2013
The Modern Java Web Developer - JavaOne 2013The Modern Java Web Developer - JavaOne 2013
The Modern Java Web Developer - JavaOne 2013
Matt Raible
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers Perspective
Mediacurrent
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React Together
Sebastian Pederiva
 
Intro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptIntro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate Javascript
Andrew Lovett-Barron
 
Learn react-js
Learn react-jsLearn react-js
React, Flux and a little bit of Redux
React, Flux and a little bit of ReduxReact, Flux and a little bit of Redux
React, Flux and a little bit of Redux
Ny Fanilo Andrianjafy, B.Eng.
 
React Native.pptx (2)
React Native.pptx (2)React Native.pptx (2)
React Native.pptx (2)
Emilio Rodriguez Martinez
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
Mark Rackley
 
What's This React Native Thing I Keep Hearing About?
What's This React Native Thing I Keep Hearing About?What's This React Native Thing I Keep Hearing About?
What's This React Native Thing I Keep Hearing About?
Evan Stone
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
Tadeu Zagallo
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
Ryan Boland
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
Mark Fayngersh
 
Angular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решенияAngular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решения
Olga Lavrentieva
 

Similar to Responsive Javascript (20)

7 Redux challenges
7 Redux challenges7 Redux challenges
7 Redux challenges
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
 
Going Mobile First With Drupal
Going Mobile First With DrupalGoing Mobile First With Drupal
Going Mobile First With Drupal
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
The ultimate guide to optimize your react native app performance in 2022
The ultimate guide to optimize your react native app performance in 2022The ultimate guide to optimize your react native app performance in 2022
The ultimate guide to optimize your react native app performance in 2022
 
Going web native
Going web nativeGoing web native
Going web native
 
The Modern Java Web Developer - JavaOne 2013
The Modern Java Web Developer - JavaOne 2013The Modern Java Web Developer - JavaOne 2013
The Modern Java Web Developer - JavaOne 2013
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers Perspective
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React Together
 
Intro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptIntro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate Javascript
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
React, Flux and a little bit of Redux
React, Flux and a little bit of ReduxReact, Flux and a little bit of Redux
React, Flux and a little bit of Redux
 
React Native.pptx (2)
React Native.pptx (2)React Native.pptx (2)
React Native.pptx (2)
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
 
What's This React Native Thing I Keep Hearing About?
What's This React Native Thing I Keep Hearing About?What's This React Native Thing I Keep Hearing About?
What's This React Native Thing I Keep Hearing About?
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
 
Angular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решенияAngular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решения
 

Recently uploaded

“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 

Recently uploaded (20)

“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 

Responsive Javascript

  • 1. Presented by your friends atPresented by your friends at Responsive JavascriptResponsive Javascript in Drupal Sitesin Drupal Sites
  • 2. About MeAbout Me CEO of Trellon on drupal.org@techsoldaten Chief Internet Strategist for Trellon One of the first Drupal firms in North America 10+ years architecting large scale Drupal environments Passionate about scalability, third-party integration, contributions Responsive Javascript in Drupal Sites
  • 3. Responsive JavascriptResponsive Javascript Responsive Javascript in Drupal Sites Scripts that run: In specific browser dimensions On devices with specific capabilities Can be activated / removed in response to changes in device dimensions, including rotation
  • 4. There's No One WayThere's No One Way Responsive Javascript in Drupal Sites Popular solutions. Each has benefits and drawbacks: jQuery Mobile jQuery Factories Conditional javascript with @media Just using display: none and duplicating the markup with a different selector
  • 5. Why is This a DrupalWhy is This a Drupal Problem?Problem? Responsive Javascript in Drupal Sites Drupal has a lot of things that don't respond well to mobile. CKEditor: Try using this on mobile Views Slideshow: No destroy method Breakpoints: No integration outside theme
  • 6. Recipe for ResponsiveRecipe for Responsive JavascriptJavascript Responsive Javascript in Drupal Sites jRespond Define breakpoints in theme Views Just views, no slideshows
  • 7. jRespondjRespond Allows you to set breakpoints Responsive Javascript in Drupal Sites <script> // adds breakpoints used by javascript var jRes = jRespond([ { label: 'handheld', enter: 0, exit: 640 },{ label: 'tablet', enter: 768, exit: 979 },{ label: 'desktop', enter: 1200, exit: 10000 } ]); </script>
  • 8. jRespondjRespond Allows you to set breakpoints Responsive Javascript in Drupal Sites <script> jRes.addFunc({ breakpoint: 'handheld', enter: function() { // turns on slideshows nav = showSlideshow('#slideshow'); }, }); function showSlideshow(item){ item.cycle(); } </script> Structured around functions that fire when dimensions change (instead of user activity)
  • 9. jRespondjRespond Allows you to set breakpoints Responsive Javascript in Drupal Sites <script> jRes.addFunc({ breakpoint: 'handheld', enter: function() { // turns on slideshows nav = showSlideshow('#slideshow'); }, // here's my exit function exit: function() { // removes slideshows '#slideshow'.cycle('destroy'); }, }); function showSlideshow(item){ item.cycle(); } </script> Code executes when users enter and exit Structured around functions that fire when dimensions change (instead of user activity)
  • 10. ViewsViews Instead of using a Views plug in to generate something, use responsive jQuery Responsive Javascript in Drupal Sites
  • 11. ExamplesExamples Let's look at some sitesLet's look at some sites