[solved] Prob with inline style on child images

  • Posts: 118
  • Thank you received: 3
11 years 5 months ago #103022

Hi

There is something that put a border: 0px as inline style on the img hikashop_child_image after a hover on it in the product page.
I can't find the code that put this inlne style, I would enjoy to not have inline style on hover on this element.

Thanks.

Last edit: 11 years 5 months ago by Brunus. Reason: taged solved

Please Log in or Create an account to join the conversation.

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 5 months ago #103036

Hi,

It is done by some javascript added by the Helper Image.
If can edit the core file directly but your modifications will be lost with updates.
So the best solution is to use a template override:
www.hikashop.com/en/support/documentatio...tation.html#override

In your case, it is the function "hikashop_image_toggle_js(&$obj)" that you want to override.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: Brunus

Please Log in or Create an account to join the conversation.

  • Posts: 118
  • Thank you received: 3
11 years 5 months ago #103047

Thanks again Jerome :)

Please Log in or Create an account to join the conversation.

  • Posts: 118
  • Thank you received: 3
11 years 5 months ago #103062

Jerome wrote: Hi,

It is done by some javascript added by the Helper Image.
If can edit the core file directly but your modifications will be lost with updates.
So the best solution is to use a template override:
www.hikashop.com/en/support/documentatio...tation.html#override

In your case, it is the function "hikashop_image_toggle_js(&$obj)" that you want to override.

Regards,


Could you please give me an exemple of code I should have in the hikashop_image.php file ?
I did not find the hikashop_image_toggle_js(&$obj) function, I found the hikashopChangeImage(id,url,x,y,obj,nAlt) function wich contains the code I want to override. I copied this function in the hikashop_image.php, deleted the code I want tp supress, but it did not work and generated an error.

IMHO, it's a strange way to add border on hovers on images. Why not to use css only for this ?

But I enjoy the possibility to override templates and views.

Sincerely.

Please Log in or Create an account to join the conversation.

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 5 months ago #103122

Hi,

The function "hikashop_image_toggle_js(&$obj)" should return the javascript which will be added in the page.
If you open the helper image (administrator/com_hikashop/helper/image.php), you will find in the function "display" the call of the function "hikashop_image_toggle_js".
Just bellow, you will find the javascript code which is added if the function does not exist. You can copy the code

$js = '
function hikashopChangeImage(id,url,x,y,obj,nAlt){ ...
and paste it in your "hikashop_image_toggle_js" function (which will end with: "return $js;".
After that, you can change the javascript code in your function in order to remove the code you do not require:
	var myEls = getElementsByClass(\'hikashop_child_image\');
	for ( i=0;i<myEls.length;i++ ) {
		myEls[i].style.border=\'0px\';
	}

	obj.childNodes[0].style.border=\'1px solid\';
Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: Brunus

Please Log in or Create an account to join the conversation.

  • Posts: 118
  • Thank you received: 3
11 years 5 months ago #103182

Hi Jerome.

With your nice help, it works. :)

Thanks a lot.
Will tag the thread solved answered.

Sincerely.

Please Log in or Create an account to join the conversation.

Time to create page: 0.038 seconds
Powered by Kunena Forum