≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Responsive html in CC
Posted by:
(you are not logged in)
Enter the missing letter in: "Internation?l"
(you are not logged in)
Text:
[quote][b]eldeibit[/b] wrote: Hi ! I'm trying to make coppercube responsive html. If the canvas measures more than 700px it shows an object, if the canvas measures less than 700px it shows it. This is my code and it runs //Before first drawing do something [code] function myFunction(x) { if (x.matches) { // If media query matches var s = ccbGetSceneNodeFromName("cubeMesh1"); ccbSetSceneNodeProperty(s, "Visible", false); } else { var s = ccbGetSceneNodeFromName("cubeMesh1"); ccbSetSceneNodeProperty(s, "Visible", true); } } var x = window.matchMedia("(max-width: 700px)") myFunction(x) // Call listener function at run time x.addListener(myFunction) // Attach listener function on state changes [/code] Does anyone see any errors? Thank you ![/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact