简体   繁体   中英

Custom cursor image is not working after redirecting application url from http to https

I redirect my application url from http to https . I am using custom cursor images for the cursor at some area in my application. Before redirecting http to https it was working fine , mean i am able to get that custom cursor images in my page. i defined url for this cursor images inside js file . I am new to this things . Can anyone help me to solve this ?

Thanks.

When you are using https, all other resources that you use must also be secure like css files, javascripts, images, ...

So you should change the links to your resources to start with either https:// or // .

If you start your links with // it would translate to http:// when pages is loaded with http and will translate to https:// when loaded using secure connection. example:

change your link like this:

<img src="http://domain.com/images/image.png"> to <img src="//domain.com/images/image.png">

and <link type="text/css" href="styles.css" rel="stylesheet" /> to <link type="text/css" href="//domain.com/styles.css" rel="stylesheet" />

Edit:

If you images are defined in css files correcting your css link will do, otherwise you should use absolute url.

If you use the way you mentoined in comment $("canvas").css({cursor: 'url(../folder/folder1/image.cur), auto'});

I suggest adding it in a class in css like:

.custom-cursor{url(../folder/folder1/image.cur)}

and then using it like:

$("canvas"). addClass('custom-cursor');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM