Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7760157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:48:32+00:00 2026-06-01T13:48:32+00:00

I have the following HTML on my web page: <input id=htmlEdit type=checkbox/> Once the

  • 0

I have the following HTML on my web page:

<input id="htmlEdit" type="checkbox"/>

Once the page has loaded the the checkbox gets styled using wijmo as follows:

   $(document).ready(function () {
      var store = window.localStorage;
      $('#htmlEdit').wijcheckbox();

This works but I have a problem in that there is a delay of 1-2 seconds between the page
showing and the element getting styled. During that delay I see the old style of checkbox.

Does anyone have any idea what I could do to reduce this delay? Can I for example make
the wijcheckbox() function fire earlier? I tried replacing document with #htmlEdit but that
didn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:48:34+00:00Added an answer on June 1, 2026 at 1:48 pm

    The challenge here is that in order to access a DOM element via javascript, the DOM element has to already be parsed by the browser and once it’s parsed by the browser, it may already be showing on screen unless it’s set to not be visible.

    The best answer here is to control the initial look via CSS styles because that will be in force as the item is parsed and it’s first display will incorporate the CSS styles.

    The fastest way you can run javascript on a given object is to put inline javascript immediately after the element in the HTML source:

    <input id="htmlEdit" type="checkbox"/>
    <script type="text/javascript>
    $('#htmlEdit').wijcheckbox();
    </script>
    

    However, this gets messy quickly if you have to do this a lot and it’s generally not a good idea to intersperse your markup and JS.

    So, if you can’t style it with CSS, then you’re probably better off making the object be initially hidden and then show it only after it’s been styled by your JS.

    <input id="htmlEdit" type="checkbox" style="visibility: hidden" />
    

    And, then make it visible in your JS after you’ve styled it appropriately:

    $(document).ready(function() {
        $('#htmlEdit').wijcheckbox().css("visibility", "visible");
    })
    

    Note: I used visibility: hidden here instead of display: none because your page will layout properly and when the checkboxes become visible, the page won’t relayout as dramatically causing things to jump around. This seems preferable to seeing the layout without the checkboxes, then seeing it reposition when the checkboxes become visible. If the new checkbox style is dramatically different, it still may shift a bit when you add the new styling, but not as dramatically when using visibility.


    If you had a bunch of these, you could make it automated with a class:

    <input class="styledCheckbox" id="htmlEdit" type="checkbox">
    

    CSS:

    /* initially hidden until wij style is applied */
    .styledCheckbox {visibility: hidden;}   
    

    Javascript:

    $(document).ready(function() {
        // add style to all checkboxes and make them visible
        $('.styledCheckbox').wijcheckbox().css("visibility", "visible");
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a HTML page which has following code. <div id=adsListContainer style=margin: 5px;>
I have the following HTML page: <div id=foobar> <?php echo $dynamicVar; ?> </div> <input
I have a page, test.php, with the following code: <html> <body> <form> <script type=text/javascript>
I have the following HTML content. When i click the button, the page doesn't
I have some very simple HTML: <div id=advisor> <div id=print_this_container> <form> <input type=button value=
For example, in the following HTML ... <form name=outerform> <input type=text name=outer1/> <input type=text
I'm really confused. I have the following html in a form: <input class=check-box id=Data__Correct
I am using a server control on a single web.forms page. I have to
My issue is the following. I have a XHTML 1.1 page that has a
I have the following form and javascript function on my web page. This is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.