Comments (2)
First, make sure JavaScript is the appropriate tool for the job. Can you do what you want with CSS instead?
If you decide you do want to use Stimulus, you can specify multiple actions in the same data-action
attribute by separating them with a space:
<div data-action="mouseover->monkey#mouseOver mouseout->monkey#mouseOut">
Note that mouseOver
and mouseOut
are poor choices for your action method names. Repeating the event name wonβt help a reader of the HTML understand what will happen when you mouse over or out of the element. Name your action methods by what will happen, not what triggers them.
from stimulus.
CSS in my case was the best solution but I was curious π
Thanks for the suggestion and advise! π
from stimulus.
Related Issues (20)
- Callback Ordering Inconsistency in Documentation HOT 1
- disconnect() not called if outlet is accessed in connect() HOT 6
- Expired certificate on a CDN HOT 1
- Wrong params passed to action when multiple actions from multiple controllers HOT 4
- Progress bar keeps on loading forever
- Question about Stimulus' life cycle HOT 2
- Conflicting Fetch between stimulus and Hotwire HOT 4
- Discussion/Questions: Hotwire and Client Side Rendering HOT 5
- Value declared with a {type: String} but no default value behave like they have a default value
- This.element is showing a previous (cached?) version of the DOM element HOT 1
- Turbo Drive: Stimulus doesn't disconnect/connect after redirection to same URL HOT 3
- Support multiple keystroke binds for KeyboardEvent Filter
- Stimulus controllers imported twice, Initialize and clickEvents firing twice HOT 5
- Outlets do not disconnect when removed via morph
- work with BigInt HOT 2
- classList.remove() doesn't do anything on target HOT 4
- [v3.2.2] Input type "date" and "datetime-local" do not display initial value HOT 3
- Load failed errors when sending fetch requests in Safari on iOS devices. HOT 1
- Value changed fires without reflecting a change HOT 2
- Outlets property name in nested controller path
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stimulus.