June 14th, 2013, 10:07 AM
[jQuery] Element creation (best practice?)
Hi! Small question..
When a user select a point on google map the options panel has to open.. now is the best practice to already make the panel and hide it .. and then show()
or is it better to create the elements .. add them to the DOM using jquery when the user clicks the button
June 14th, 2013, 11:28 PM
Is the "option panel" dynamic or static? If it is dynamic (made on the fly) and has multiple options/interaction features; I would build it with DOM (especially if your getting JS, JSON, JSONP, XML, etc. data from Google). Otherwise; if it was static and had limited options/interaction features; I would pre-build and show/hide element. Just my opinion; as "I am a non-attorney spokesperson" jk (seen to many lawyer commericals lately lol), but no (for real)..., yeah; that would be my approach, but I cannot speak to what W3C's outlined recommendation is... to your/their Q&A.
June 15th, 2013, 07:22 AM
Thanks for the nice response! When u select a marker on the google maps, in the flyout panel, you can choose which icon you want it to have and you can add a description.. So there is interactivity, but it's always the same interactivity.. I'm gonna take a look on how to build elements from the DOM. doesn't seem easy
Originally Posted by web_loone08
June 16th, 2013, 09:49 PM
It may look complicated, at first; but once you get it down... it's a piece of cake.
Originally Posted by notflip