click gets detected when function is called
<p>I have a function that looks like this:</p>

<pre><code>function reset_all_lightbox_assets()
{
    $(document).one("click", function () {  
        $("#lightbox-asset-wrapdiv .category-asset-div-tileview").css({"background-color": "#f9f9f9"});
        $("#lightbox-asset-wrapdiv .category-asset-table-td-category,#lightbox-asset-wrapdiv .category-asset-table-td-id").css("color", "#777777");
        $("#lightbox-asset-wrapdiv .category-asset-table-td-name").css("color", "#999999");
    });
}
</code></pre>

<p>When this function is called I want to be able to click the document once and execute the code.</p>

<p>The problem is that when the function is called, it also immediately detects the click. So how can I call the function so the click becomes enabled but only gets executed when I actually click again?</p>
