{"action":"created","issue":{"url":"https://api.github.com/repos/openseadragon/openseadragon/issues/804","labels_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/804/labels{/name}","comments_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/804/comments","events_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/804/events","html_url":"https://github.com/openseadragon/openseadragon/issues/804","id":123186867,"number":804,"title":"Interactive change opacity of tilesource","user":{"login":"SamHall","id":4950023,"avatar_url":"https://avatars.githubusercontent.com/u/4950023?v=3","gravatar_id":"","url":"https://api.github.com/users/SamHall","html_url":"https://github.com/SamHall","followers_url":"https://api.github.com/users/SamHall/followers","following_url":"https://api.github.com/users/SamHall/following{/other_user}","gists_url":"https://api.github.com/users/SamHall/gists{/gist_id}","starred_url":"https://api.github.com/users/SamHall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamHall/subscriptions","organizations_url":"https://api.github.com/users/SamHall/orgs","repos_url":"https://api.github.com/users/SamHall/repos","events_url":"https://api.github.com/users/SamHall/events{/privacy}","received_events_url":"https://api.github.com/users/SamHall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-20T22:29:37Z","updated_at":"2015-12-21T00:59:56Z","closed_at":null,"body":"I've positioned two tilesources on top of each other and can set variables for opacity of each.\r\nI want to change the opacity of a tilesource via click on a button id, or even add a transition upon the click to fade the object in or out.\r\n\r\nCode below and page here:  http://deepzoomchattanooga.com/theboulevard.php\r\n\r\nIn this case, when the button is clicked I want the tilesource's opacity set by the value of op2 to change from 1.0 to 0.2.\r\n\r\nWhat am I missing?  Thank you.\r\n\r\n```\r\n<button id=\"pg01\">Change Opacity</button></div>\r\n```\r\n```\r\nvar op1 = 0.6;\r\nvar op2 = 1.0;\r\n\r\n$(\"#pg01\").click(function (){\r\nvar op1 = 0.1;\r\n});\r\n\r\nvar viewer = new OpenSeadragon.Viewer({\r\n    id: \"openseadragon-canvas\",\r\n    prefixUrl: \"/openseadragon/images_TEST/\",\r\n    navigationControlAnchor: OpenSeadragon.ControlAnchor.TOP_RIGHT,\r\n    showHomeControl: false,\r\n    showZoomControl: false,\r\n\r\n    tileSources: [{\r\n            x: 0.883,\r\n            y: 1,\r\n            width: 1,\r\n            opacity: op2,\r\n            tileSource: \"/zoom/boulevard1/dzc_output.xml\",\r\n        },\r\n\r\n        {\r\n            x: 1,\r\n            y: 1,\r\n            width: 0.61,\r\n            opacity: op1,\r\n            tileSource: \"/zoom/boulevard4/dzc_output.xml\"\r\n\r\n        }\r\n   ] \r\n\t\r\n});\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/openseadragon/openseadragon/issues/comments/166169453","html_url":"https://github.com/openseadragon/openseadragon/issues/804#issuecomment-166169453","issue_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/804","id":166169453,"user":{"login":"SamHall","id":4950023,"avatar_url":"https://avatars.githubusercontent.com/u/4950023?v=3","gravatar_id":"","url":"https://api.github.com/users/SamHall","html_url":"https://github.com/SamHall","followers_url":"https://api.github.com/users/SamHall/followers","following_url":"https://api.github.com/users/SamHall/following{/other_user}","gists_url":"https://api.github.com/users/SamHall/gists{/gist_id}","starred_url":"https://api.github.com/users/SamHall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamHall/subscriptions","organizations_url":"https://api.github.com/users/SamHall/orgs","repos_url":"https://api.github.com/users/SamHall/repos","events_url":"https://api.github.com/users/SamHall/events{/privacy}","received_events_url":"https://api.github.com/users/SamHall/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T00:59:56Z","updated_at":"2015-12-21T00:59:56Z","body":"Antoine - Thank you for the solution and the details.\r\nJavaScript is obviously not my strong point.  I tried many different attempts, and had actually at one time fixed issue #1 (the variable would show changed in the console) and narrowed the next part down to something that began with viewer.xxxx.\r\n\r\nBut alas, the API is a sea of possibilities and I look for / learn by examples vs. the API.\r\n\r\nYour info will no doubt get me past the temporary block.\r\n\r\nThanks again,\r\nSam"}}