5
5
50VAJJ2017-03-07 23:03:06
Django
50VAJJ, 2017-03-07 23:03:06

Onmouseover not working with Django?

Hello. I copied the html into django, everything seems to be set up, there are pictures, etc. But here's the problem with onmouseover - it doesn't work.
Tried it like this -

onmouseover="this.src={% static 'res/ico/instagram_h.png'%}"

So -
onmouseover="this.src="{% static 'res/ico/instagram_h.png'%}"

So -
onmouseover= "{% static 'res/ico/instagram_h.png'%}"

And a bunch of other options, but the picture does not change, although if you just load the html file into the browser, then everything works.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
devalone, 2017-03-07
@devalone

So you look at what the template engine generates and compare with "just an html file", and do not brute force the correct version of the code.

5
50VAJJ, 2017-03-08
@50VAJJ

devalone :

<a href="#"><img src="/static/res/ico/instagram.png" onmouseover="this.src=/static/res/ico/instagram_h.png" onmouseout="this.src='/static/res/ico/instagram.png" alt=""></a>

Also, I point the code at the first link, then my picture appears, from the second and third it doesn’t work out that way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question