- Screen name: vlajce
vlajce's Profile
2 Posts
4 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- Hello and happy 2019What I want to achieve is to make "select to inspect" type of functionality, just like the browsers have. It should only have the functionality of creating a temporary element that will be overlayed over the element that my mouse is hovering on.I have created a screencast to show you what it should be like, and what I currently have.This is my code written with jQueryIt creates a DIV on the page and then, on mousemove event, I set its values (height, width, and the position)to be the same as the element that I am hovering on. But what I get is some glitchy windows when I hover over.What am I missing here?function create_div(){let style = `background-color: rgba(130, 180, 230, 0.5);outline: solid 1px #0F4D9A;box-sizing: border-box;position: absolute;display: block;z-index: 999999;`let e = document.createElement('DIV')e.setAttribute('id', 'tester')e.setAttribute('style', style)document.body.appendChild( e )}create_div()$( "body" ).mousemove(function( event ) {$( '#tester' ).css({'display' : 'none'})let target = $( event.target )$( '#tester' ).css({'display' : 'block', "width": target.width(),'height': target .height(), 'top' : target .offset().top,'left' : target .offset().left});})
- 07-Nov-2018 06:43 PM
- Forum: Using jQuery UI
I've been experimenting with that library and I really liked it. However, I've been searching through their documentation twice from top to bottom and haven't found the method that I need.
Basically, at the start, all I have is an empty slider (div or input with CSS), without knobs on them. When I click on that element, I need to generate the min value knob and when I release the mouse click, I want to generate second knob (max value) on that slider/element. Yes, two knobs. Min value and max value.
All that I have seen on the documentation is that I am already provided with knobs on fixed positions and then I interact/change with them after.
Is that possible at all or do I need to hack somehow to get it working as I wanted?
Thanks
- «Prev
- Next »
Moderate user : vlajce

