Skip to content

Instantly share code, notes, and snippets.

@vschoettke
Created May 20, 2016 08:29
Show Gist options
  • Save vschoettke/8f722779f1675f175fe399fc0ae384ec to your computer and use it in GitHub Desktop.
Save vschoettke/8f722779f1675f175fe399fc0ae384ec to your computer and use it in GitHub Desktop.
module Main exposing (..)
import Html exposing (Html, ul, li, div, text)
import Html.App as Html
import Html.Events exposing (onMouseEnter)
main =
Html.beginnerProgram { model = 0, view = view, update = update }
type Msg
= Select Int
update msg model =
case (Debug.log "Msg" msg) of
Select x ->
x
view model =
div []
[ text
("Move mouse over \"Second\" (\"First\" will turn to upper case). "
++ "Now alterate between moving the mouse over this text and \"First\" "
++ "and you will get an Uncaught TypeError: Cannot read property 'decoder' of null"
)
, ul []
[ if (model == 1) then
li [ onMouseEnter (Select 0) ] [ text "FIRST" ]
else
li [] [ text "First" ]
, li [ onMouseEnter (Select 1) ] [ text "Second" ]
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment