|
5 | 5 |
|
6 | 6 | let showTooltip = false;
|
7 | 7 | let autoHideTooltip = true;
|
8 |
| - ``; |
| 8 | +
|
9 | 9 | setTimeout(() => {
|
10 | 10 | autoHideTooltip = false;
|
11 | 11 | }, 5000);
|
|
408 | 408 | <section>
|
409 | 409 | <h2>Playground</h2>
|
410 | 410 | </section>
|
411 |
| - <section class="relative-with-offset"> |
412 |
| - <p> |
| 411 | + <div> |
| 412 | + <p class="relative-with-offset"> |
413 | 413 | Mouse over <strong
|
414 | 414 | use:tooltip={{ content: 'Hello world', position: 'left' }}>me</strong
|
415 |
| - > to see a tooltip in the correct position. |
416 |
| - </p> |
417 |
| - </section> |
418 |
| - <div class="relative-with-offset"> |
419 |
| - <p> |
420 |
| - Mouse over <strong |
421 |
| - use:tooltip={{ content: 'Hello world', position: 'left' }}>me</strong |
422 |
| - > to see a tooltip in the wrong position. |
| 415 | + > to see a left positioned tooltip with relative offset parent |
423 | 416 | </p>
|
424 | 417 | </div>
|
425 | 418 | <div class="relative-with-offset">
|
426 | 419 | <p>Mouse over</p>
|
427 | 420 | <strong use:tooltip={{ content: 'Hello world', position: 'bottom' }}
|
428 | 421 | >me</strong
|
429 | 422 | >
|
430 |
| - <p>to see a tooltip in the wrong position.</p> |
| 423 | + <p>to see a bottom positioned tooltip with relative offset parent.</p> |
431 | 424 | </div>
|
432 | 425 | <div class="relative-with-offset">
|
433 | 426 | <p>Mouse over</p>
|
434 | 427 | <strong
|
435 | 428 | class="absolute-child"
|
436 | 429 | use:tooltip={{ content: 'Hello world', position: 'top' }}>me</strong
|
437 | 430 | >
|
438 |
| - <p>to see a tooltip in the wrong position.</p> |
| 431 | + <p>to see a top positioned tooltip.</p> |
439 | 432 | </div>
|
440 | 433 | <p>A bunch of paragraphs.</p>
|
441 | 434 | <p>A bunch of paragraphs.</p>
|
|
445 | 438 | <p>A bunch of paragraphs.</p>
|
446 | 439 | <div class="relative-with-offset">
|
447 | 440 | <p>
|
448 |
| - Mouse over <strong |
| 441 | + Mouse <strong |
449 | 442 | class="absolute-child"
|
450 |
| - use:tooltip={{ content: 'Hello world', position: 'right' }}>me</strong |
451 |
| - > to see a tooltip in |
452 |
| - the wrong position. |
| 443 | + use:tooltip={{ content: 'Hello world', position: 'right' }}>over</strong> |
| 444 | + this relative parent with absolute child. |
453 | 445 | </p>
|
454 | 446 | </div>
|
455 | 447 | <p>A bunch of paragraphs.</p>
|
|
465 | 457 | <p>A bunch of paragraphs.</p>
|
466 | 458 | <p>A bunch of paragraphs.</p>
|
467 | 459 | </main>
|
468 |
| -<p>Mouse over <strong use:tooltip={{ content: 'Hello world', position: 'left' }}>me</strong> to see a tooltip in the correct position.</p> |
| 460 | +<p>Mouse over <strong use:tooltip={{ content: 'Hello world', position: 'left' }}>me</strong> static tooltip element.</p> |
469 | 461 | <div class="relative-with-offset">
|
470 |
| - <p>Mouse over <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'top' }}>me</strong> to see a tooltip in the wrong position.</p> |
| 462 | + <p>Mouse over <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'top' }}>me</strong> with relative offset parent and absolute child.</p> |
471 | 463 | </div>
|
472 | 464 | <div class="relative-with-offset">
|
473 | 465 | <p>Mouse over</p>
|
474 |
| - <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'bottom' }}>me</strong> |
475 |
| - <p>to see a tooltip in the wrong position.</p> |
| 466 | + <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'bottom' }}>this</strong> |
| 467 | + <p>relative parent with offset and absolute child.</p> |
476 | 468 | </div>
|
477 | 469 | <div class="relative-with-offset">
|
478 | 470 | <p>Mouse over</p>
|
479 | 471 | <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'right' }}>me</strong>
|
480 |
| - <p>to see a tooltip in the wrong position.</p> |
| 472 | + <p>relative parent with offset and absolute child.</p> |
481 | 473 | </div>
|
482 | 474 | <p>A bunch of paragraphs.</p>
|
483 | 475 | <p>A bunch of paragraphs.</p>
|
|
486 | 478 | <p>A bunch of paragraphs.</p>
|
487 | 479 | <p>A bunch of paragraphs.</p>
|
488 | 480 | <div class="relative">
|
489 |
| - <p>Mouse over <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'left' }}>me</strong> to see a tooltip in the wrong position.</p> |
| 481 | + <p>Mouse over <strong class="absolute-child" use:tooltip={{ content: 'Hello world', position: 'right' }}>me</strong> with relative parent (no offset) and absolute child.</p> |
490 | 482 | </div>
|
491 | 483 | <p>A bunch of paragraphs.</p>
|
492 | 484 | <p>A bunch of paragraphs.</p>
|
|
497 | 489 | <p>A bunch of paragraphs.</p>
|
498 | 490 | <div>
|
499 | 491 | <p class="transform">
|
500 |
| - This tooltip is using transform on the element - <u |
| 492 | + Tooltip is using a CSS transform on the tooltip element - show <u |
501 | 493 | title="hello world!"
|
502 | 494 | action="click"
|
503 | 495 | use:tooltip>top</u
|
|
512 | 504 |
|
513 | 505 | <div class="transform">
|
514 | 506 | <p>
|
515 |
| - This tooltips parent is using a transform - <u |
| 507 | + Tooltip parent is using a CSS transform - show <u |
516 | 508 | title="hello world!"
|
517 | 509 | action="click"
|
518 | 510 | use:tooltip>top</u
|
|
528 | 520 |
|
529 | 521 | <div class="relative transform">
|
530 | 522 | <p>
|
531 |
| - This tooltips parent is relative using a transform - <u |
| 523 | + Tooltip parent is relative and using a CSS transform - show <u |
532 | 524 | title="hello world!"
|
533 | 525 | action="click"
|
534 | 526 | use:tooltip>top</u
|
|
542 | 534 |
|
543 | 535 | <div class="transform" style="position: absolute; left: 300px;">
|
544 | 536 | <p>
|
545 |
| - This tooltips parent is absolute using a transform - <u |
| 537 | + Tooltip parent is absolute and using a CSS transform - show <u |
546 | 538 | title="hello world!"
|
547 | 539 | action="click"
|
548 | 540 | use:tooltip>top</u
|
|
0 commit comments