PDA

View Full Version : Existing code needs altering to suit



theremotedr
01-07-2017, 12:58 PM
Afternoon people,
Here is a page in question http://www.theremotedoctor.co.uk/accsuzuki.html?scrollto=selection

Please select *CLONING SERVICE" from the Item selection list.
Now you will see the selection image has been loaded.
When you place your mouse "Pc" or click"Phone" on the CLICK FOR Price button a message prompt pops up.
So far this is all working correctly BUT the altering of the code is from here on.

On this page the CLICK TO ORDER button is not required,so either hide it or remove it
Must remember that the CLICK TO ORDER button is used on my other pages.
Depending on the action taken then have the CLICK FOR PRICE central.

I was trying to remove / hide the CLICK TO ORDER button BUT then the message prompt did not show for when you selected the CLICK FOR PRICE button.

coothead
01-07-2017, 04:18 PM
Hi there theremotedr,


do you want the the "CLICK TO ORDER button to be hidden only when the
*CLONING SERVICE* button itself is clicked or entirely from the page itself?


coothead

theremotedr
01-07-2017, 04:28 PM
Hi,

I think it would be nice for,
"CLICK TO ORDER" button to be hidden only when the *CLONING SERVICE* button itself is clicked

This would be just for customers information AND NOT being able to "CLICK TO ORDER" as you will not be able to order anything.

coothead
01-07-2017, 05:34 PM
Hi there theremotedr,


checkout the attachment. ;)


coothead

theremotedr
01-07-2017, 05:54 PM
Great.
Could you tidy this redundant code please.
The Ford020 is not required as it was going to self populate a form once the CLICK TO ORDER was pressed.
The Ford020 is used on another page but they wont be affected when cleaning this code.
Ive tried but i either dont get the pop up or other.


<li><a href="javascript:" id="cloning" onclick="replaceMainImage('m-images/photos/suzuki-cloning-service.png', 'Ford020','<b>** Transponder Chip Cloning **</b><br>For Chips Shown In Listing<br>Please Contact Me For Price<br><b>Royal Mail Next Day</b><br></b><b>Special Delivery By 1pm Used</b><br><scan class=drColor>The Remote Doctor</scan>')">** CLONING SERVICE **</a></li>

coothead
01-07-2017, 07:14 PM
Hi there theremotedr,



if you want to safely remove the 'FORD020' from here...



.........service.png', 'Ford020','<b>** Trans..........

...then do it like this...



.........service.png', ' ','<b>** Trans..........

Note, though, that you do not have to leave all that white-space.


coothead

theremotedr
01-07-2017, 07:22 PM
Coothead,
Ive made an edit to the js file as i changed its text on the button.
It works fine & the button text is now ** CLONING SERVICE **

Would i be messing you around if i was to ask for this.
Once you select ** CLONING SERVICE ** the photo is loaded & the CLICK TO ORDER button does not show which is spot on.
The changed would be,as opposed to showing the current CLICK FOR PRICE button show the new button CLICK FOR INFO to be shown instead.

I thought it might make sense to have CLICK FOR INFO as opposed to CLICK FOR PRICE seeing no price is mentioned ?
If you think this is me being to fussy then i will leave it and go with whats currently in use.
If you think it makes sense then please make the change.

Code in use so far due to me text change.

(function(){
'use strict';
var a=document.getElementById('secondary-navigation').getElementsByTagName('a');
for(var c=0;c<a.length;c++) {
a[c].addEventListener('click',

function() {
if(this.firstChild.nodeValue==='** CLONING SERVICE **'){
document.getElementById('btnOrder1').style.display='none';
}
else {
document.getElementById('btnOrder1').style.display='inline';
}
},false);
}
}());

CLICK FOR INFO path, http://www.theremotedoctor.co.uk/m-images/info-logo.png

Many Thanks,
I await your respected opinion.

coothead
01-07-2017, 07:43 PM
Hi there theremotedr,


I agree that "CLICK FOR INFO" as opposed to "CLICK FOR PRICE"
makes more sense and it is very easy for you to amend the code.



coothead

theremotedr
01-07-2017, 08:12 PM
I wasnt sure if the edit would be in the js file or on the actual page itself.

theremotedr
01-07-2017, 08:25 PM
Just to clarify,
I was going to use the CLICK FOR PRICE for the other buttons and CLICK FOR INFO only for the CLONING SERVICE button.

I think your reply regarding me changing the code was to use the CLICK FOR INFO on all the buttons.

Correct ?

coothead
01-07-2017, 08:33 PM
Hi there theremotedr,


I was just teasing. ;)

Add this id here on line 211...



<img id="price-logo" src="m-images/price-logo.png" alt="remote doctor information button" class="tooltip border buttonshadow" ></a></h1>

...and amend the script as shown...



(function(){
'use strict';
var a=document.getElementById('secondary-navigation').getElementsByTagName('a');
for(var c=0;c<a.length;c++) {
a[c].addEventListener('click',

function() {
if(this.firstChild.nodeValue==='** CLONING SERVICE **'){
document.getElementById('btnOrder1').style.display='none';
document.getElementById('price-logo').src='m-images/info-logo.png';
}
else {
document.getElementById('btnOrder1').style.display='inline';
document.getElementById('price-logo').src='m-images/price-logo.png';
}
},false);
}
}());



coothead

theremotedr
01-07-2017, 08:56 PM
Ha Ha.
Now sorted.
I have noticed an issue at my end and asking you to check your end please.
2 steps.

1,
Go here http://www.theremotedoctor.co.uk/accford.html?scrollto=selection
Now put your cursor over the KEYS & REMOTES header & then bring your cursor down so you then see AUDI, BMW, FIAT, FORD being highlited in blue as you come all the way down to VOLKSWAGEN.

2,
Whilst on the same page http://www.theremotedoctor.co.uk/accford.html?scrollto=selection
This time select ** CLONING SERVICE **
Now do the same with respect KEYS & REMOTES then watch as you come down through the list AUDI, BMW, FIAT, FORD to the end.

Please advise if anything happens whilst you come down through the list.

I await your reply.
Thanks

coothead
01-07-2017, 09:44 PM
Hi there theremotedr,


I could not see anything untoward.

What are you seeing?

I did notice, though, that the "stopClickToOrder.js" does not work
in Chrome but does in Opera which uses the same engine.

Is it just my Chrome or are is it not working in yours either?



coothead

theremotedr
01-07-2017, 10:09 PM
I didn't notice anything wrong with the stopClickToOrder file, I am also using Chrome.
I visit the page, I see CLICK FOR PRICE & CLICK TO ORDER buttons, I select CLONING SERVICE, image is loaded & I see only CLICK FOR INFO button centred below the image,I select the CLICK FOR INFO button, message pops up and I believe it's fine.
The above is what should happen and I don't see anything wrong at my end,will check these pages again tomorrow to confirm.

What I do see, and asked you to check is after I select CLONING SERVICE & start to scroll down the KEYS & REMOTES list AUDI,BMW etc etc, when I get to JAGUAR the list closes/disappears as if I moved the cursor off of the list.
I've noticed this in a few but not all of the pages that have the CLONING SERVICE button installed.
Tomorrow I will confirm which have the issue.

I've done this a few times today and it defiantly happens at my end.
I couldn't see it happen on a page that didn't have the CLONING SERVICE.
I also checked it in Firefox and the same.

I ALSO NOW USE CTRL & F5 TO REFRESH THE PAGE AFTER MAKING AN EDIT & 100% SPOT ON.