My current code:
$(document).ready(function () {
$(document).on('click', function (e) {
$(".totalHere").empty();
$(".summaryTotal").clone().appendTo(".totalHere");
if (jQuery("#stepOneHeader").data("clicked")) {
if ($("#trackPoleWidth").is(":empty")) {
$(".customisationSummaryTable").children("p.clearfix").clone().appendTo(".totalHere");
} else if ($("#drop").is(":empty")) {
$(".customisationSummaryTable").children("p.clearfix").clone().appendTo(".totalHere");
};
};
});
});
I'm working on a mobile site at the moment - unfortunately I couldn't link it here - and I was tasked to append a fixed message at the bottom of the page to alert visitors using jQuery.
My current problem is that I have to detect if the visitor has clicked the element #stepOneHeader, and also if the first input box #trackPoleWidth is empty after the element #stepOneHeader was clicked. If the answer is yes, then a message will be append to the bottom of the page, alerting the visitor.
On the other hand, if the answer is no, then the append location is left empty.
The first rows of codes are working until the IF statement.
I think my code isn't working because I didn't structured it properly, but I don't know how to correct it. Please help me.
Thank you very much for your time,
Aucun commentaire:
Enregistrer un commentaire