|
Lines 479-481
YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) {
Link Here
|
| 479 |
} |
479 |
} |
| 480 |
}; |
480 |
}; |
| 481 |
YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"}); |
481 |
YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"}); |
|
|
482 |
¾@,V"ŢѡÁ´¡tion(el) { |
| 483 |
}; |
| 484 |
|
| 485 |
/** |
| 486 |
* Background image object. A background image is one whose URL is specified by "background-image" in the element's style |
| 487 |
* @class YAHOO.util.ImageLoader.bgImgObj |
| 488 |
* @constructor |
| 489 |
* @extends YAHOO.util.ImageLoader.imgObj |
| 490 |
* @param {String} domId HTML DOM id of the image element |
| 491 |
* @param {String} url URL for the image |
| 492 |
*/ |
| 493 |
YAHOO.util.ImageLoader.bgImgObj = function(domId, url) { |
| 494 |
YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url); |
| 495 |
}; |
| 496 |
|
| 497 |
YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj); |
| 498 |
|
| 499 |
/** |
| 500 |
* Inserts the image URL into the DOM so that the image is displayed. |
| 501 |
* Sets style.backgroundImage |
| 502 |
* @method _applyUrl |
| 503 |
* @param {Object} el HTML DOM element |
| 504 |
* @private |
| 505 |
*/ |
| 506 |
YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) { |
| 507 |
el.style.backgroundImage = "url('" + this.url + "')"; |
| 508 |
}; |
| 509 |
|
| 510 |
/** |
| 511 |
* Source image object. A source image is one whose URL is specified by a src attribute in the DOM element |
| 512 |
* @class YAHOO.util.ImageLoader.srcImgObj |
| 513 |
* @constructor |
| 514 |
* @extends YAHOO.util.ImageLoader.imgObj |
| 515 |
* @param {String} domId HTML DOM id of the image element |
| 516 |
* @param {String} url URL for the image |
| 517 |
* @param {Int} width pixel width of the image - defaults to image's natural size |
| 518 |
* @param {Int} height pixel height of the image - defaults to image's natural size |
| 519 |
*/ |
| 520 |
YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) { |
| 521 |
YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url); |
| 522 |
this.width = width; |
| 523 |
this.height = height; |
| 524 |
}; |
| 525 |
|
| 526 |
YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj); |
| 527 |
|
| 528 |
/** |
| 529 |
* Inserts the image URL into the DOM so that the image is displayed. |
| 530 |
* Sets src |
| 531 |
* @method _applyUrl |
| 532 |
* @param {Object} el HTML DOM element |
| 533 |
* @private |
| 534 |
*/ |
| 535 |
YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) { |
| 536 |
el.src = this.url; |
| 537 |
}; |
| 538 |
|
| 539 |
/** |
| 540 |
* PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style |
| 541 |
* @class YAHOO.util.ImageLoader.pngBgImgObj |
| 542 |
* @constructor |
| 543 |
* @extends YAHOO.util.ImageLoader.imgObj |
| 544 |
* @param {String} domId HTML DOM id of the image element |
| 545 |
* @param {String} url URL for the image |
| 546 |
* @param {Object} ailProps The AlphaImageLoader properties to be set for the image |
| 547 |
* Valid properties are 'sizingMethod' and 'enabled' |
| 548 |
*/ |
| 549 |
YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url, ailProps) { |
| 550 |
YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url); |
| 551 |
|
| 552 |
/** |
| 553 |
* AlphaImageLoader properties to be set for the image. |
| 554 |
* Valid properties are "sizingMethod" and "enabled". |
| 555 |
* @property props |
| 556 |
* @type Object |
| 557 |
*/ |
| 558 |
this.props = ailProps || {}; |
| 559 |
}; |
| 560 |
|
| 561 |
YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj); |
| 562 |
|
| 563 |
/** |
| 564 |
* Inserts the image URL into the DOM so that the image is displayed. |
| 565 |
* If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage |
| 566 |
* @method _applyUrl |
| 567 |
* @param {Object} el HTML DOM element |
| 568 |
* @private |
| 569 |
*/ |
| 570 |
YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) { |
| 571 |
if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) { |
| 572 |
var sizingMethod = (YAHOO.lang.isUndefined(this.props.sizingMethod)) ? 'scale' : this.props.sizingMethod; |
| 573 |
var enabled = (YAHOO.lang.isUndefined(this.props.enabled)) ? 'true' : this.props.enabled; |
| 574 |
el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="' + sizingMethod + '", enabled="' + enabled + '")'; |
| 575 |
} |
| 576 |
else { |
| 577 |
el.style.backgroundImage = "url('" + this.url + "')"; |
| 578 |
} |
| 579 |
}; |
| 580 |
YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"}); |
| 581 |
7»Rê,drÔ*îÐtion(el) { |
| 582 |
}; |
| 583 |
|
| 584 |
/** |
| 585 |
* Background image object. A background image is one whose URL is specified by "background-image" in the element's style |
| 586 |
* @class YAHOO.util.ImageLoader.bgImgObj |
| 587 |
* @constructor |
| 588 |
* @extends YAHOO.util.ImageLoader.imgObj |
| 589 |
* @param {String} domId HTML DOM id of the image element |
| 590 |
* @param {String} url URL for the image |
| 591 |
*/ |
| 592 |
YAHOO.util.ImageLoader.bgImgObj = function(domId, url) { |
| 593 |
YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url); |
| 594 |
}; |
| 595 |
|
| 596 |
YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj); |
| 597 |
|
| 598 |
/** |
| 599 |
* Inserts the image URL into the DOM so that the image is displayed. |
| 600 |
* Sets style.backgroundImage |
| 601 |
* @method _applyUrl |
| 602 |
* @param {Object} el HTML DOM element |
| 603 |
* @private |
| 604 |
*/ |
| 605 |
YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) { |
| 606 |
el.style.backgroundImage = "url('" + this.url + "')"; |
| 607 |
}; |
| 608 |
|
| 609 |
/** |
| 610 |
* Source image object. A source image is one whose URL is specified by a src attribute in the DOM element |
| 611 |
* @class YAHOO.util.ImageLoader.srcImgObj |
| 612 |
* @constructor |
| 613 |
* @extends YAHOO.util.ImageLoader.imgObj |
| 614 |
* @param {String} domId HTML DOM id of the image element |
| 615 |
* @param {String} url URL for the image |
| 616 |
* @param {Int} width pixel width of the image - defaults to image's natural size |
| 617 |
* @param {Int} height pixel height of the image - defaults to image's natural size |
| 618 |
*/ |
| 619 |
YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) { |
| 620 |
YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url); |
| 621 |
this.width = width; |
| 622 |
this.height = height; |
| 623 |
}; |
| 624 |
|
| 625 |
YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj); |
| 626 |
|
| 627 |
/** |
| 628 |
* Inserts the image URL into the DOM so that the image is displayed. |
| 629 |
* Sets src |
| 630 |
* @method _applyUrl |
| 631 |
* @param {Object} el HTML DOM element |
| 632 |
* @private |
| 633 |
*/ |
| 634 |
YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) { |
| 635 |
el.src = this.url; |
| 636 |
}; |
| 637 |
|
| 638 |
/** |
| 639 |
* PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style |
| 640 |
* @class YAHOO.util.ImageLoader.pngBgImgObj |
| 641 |
* @constructor |
| 642 |
* @extends YAHOO.util.ImageLoader.imgObj |
| 643 |
* @param {String} domId HTML DOM id of the image element |
| 644 |
* @param {String} url URL for the image |
| 645 |
* @param {Object} ailProps The AlphaImageLoader properties to be set for the image |
| 646 |
* Valid properties are 'sizingMethod' and 'enabled' |
| 647 |
*/ |
| 648 |
YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url, ailProps) { |
| 649 |
YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url); |
| 650 |
|
| 651 |
/** |
| 652 |
* AlphaImageLoader properties to be set for the image. |
| 653 |
* Valid properties are "sizingMethod" and "enabled". |
| 654 |
* @property props |
| 655 |
* @type Object |
| 656 |
*/ |
| 657 |
this.props = ailProps || {}; |
| 658 |
}; |
| 659 |
|
| 660 |
YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj); |
| 661 |
|
| 662 |
/** |
| 663 |
* Inserts the image URL into the DOM so that the image is displayed. |
| 664 |
* If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage |
| 665 |
* @method _applyUrl |
| 666 |
* @param {Object} el HTML DOM element |
| 667 |
* @private |
| 668 |
*/ |
| 669 |
YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) { |
| 670 |
if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) { |
| 671 |
var sizingMethod = (YAHOO.lang.isUndefined(this.props.sizingMethod)) ? 'scale' : this.props.sizingMethod; |
| 672 |
var enabled = (YAHOO.lang.isUndefined(this.props.enabled)) ? 'true' : this.props.enabled; |
| 673 |
el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="' + sizingMethod + '", enabled="' + enabled + '")'; |
| 674 |
} |
| 675 |
else { |
| 676 |
el.style.backgroundImage = "url('" + this.url + "')"; |
| 677 |
} |
| 678 |
}; |
| 679 |
YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"}); |
| 680 |
|