我在我的iPhone游戏中正在开发一个通知系统,想要在屏幕上弹出一个图像并在2秒后自动褪色.
有没有办法做到这一点?提前谢谢.
我试图淡入并淡出一个QLabel或任何子QWidget类.我尝试过QGraphicsEffect,但不幸的是它只适用于Windows而不适用于Mac.
唯一可以同时适用于Mac和Windows的其他解决方案似乎是我自己的自定义paintEvent设置不透明度,QPainter并Q_PROPERTY在我的派生中定义"不透明度" QLabel并通过改变不透明度QPropertyAnimation.
我粘贴在相关代码段下方供您参考.我仍然在这里看到一个问题 - 重复使用QLabel::paintEvent它似乎不起作用,它只有在我使用它完成一个完整的自定义绘画时才有效QPainter,但这似乎不是一个简单的方法,如果我需要为每个人都这样做QWidget子类我想淡出,这是一场噩梦.请澄清我在这里是否有任何明显的错误.
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
void MyLabel::setOpacity(qreal value) {
    m_Opacity = value;
    repaint();
}
void MyLabel::paintEvent((QPaintEvent *pe) {
    QPainter p;
    p.begin(this);
    p.setOpacity();
    QLabel::paintEvent(pe);
    p.end();
}
void MyLabel::startFadeOutAnimation() {
    QPropertyAnimation *anim = new QPropertyAnimation(this, "opacity");
    anim->setDuration(800);
    anim->setStartValue(1.0);
    anim->setEndValue(0.0);
    anim->setEasingCurve(QEasingCurve::OutQuad);
    anim->start(QAbstractAnimation::DeleteWhenStopped);
}
我将以下HTML表呈现给我的浏览器.我正在从我的ASP.NET代码隐藏文件创建此表.
<table Class="tblTradeInCart">
    <tr class="tblCartHeader">
        <td>Item</td>
        <td>Model</td>
        <td> Price</td>
        <td>Delete</td>
    </tr>
    <tr id="tr_15_1">
        <td><img src="dia/images/LGVX9700.jpg" width="50" height="50" /></td>
        <td>LG VX9700</td>
        <td>$ 122</td>
        <td><a href='#' onclick="deleteItem(15,1,'tr_15_1')"><img src='..\Lib\images\NCcross.gif' style='border:0px'></a></td>
    </tr>
    <tr id="tr_11_8">
        <td><img src="dia/images/NOK5610.jpg" width="50" height="50" /></td>
        <td>NOKIA 5610</td>
        <td>$ 122</td>
        <td><a href='#' onclick="deleteItem(11,8,'tr_11_8')"><img src='..\Lib\images\NCcross.gif' style='border:0px'></a></td>
    </tr>
    <tr id="tr_14_9">
        <td><img src="dia/images/NOKN95.jpg" width="50" height="50" /></td>
        <td>NOKIA N95</td>
        <td>$ 91.5</td>
        <td><a href='#' onclick="deleteItem(14,9,'tr_14_9')"><img src='..\Lib\images\NCcross.gif' style='border:0px'></a></td>
    </tr>
</table>
在我的JavaScript中我有删除功能如下
function deleteItem(modelId,itemindexId, rowId)
{
   $.get("RemoveFromCart.aspx",{ model:modelId,cartItem:itemindexId,mode:"removefromcart",rand:Math.random() } ,function(data)
 { 
    //document.getElementById(rowId).style.display = "none";
    var row=$("#"+rowId);     
   row.fadeOut(1000);
}); …任何人都可以告诉我为什么.jpg不会在IE8中淡入淡出或淡出.现在它只是消失并重新出现,没有不透明度的变化.我在本地设置并在发布服务器上设置,奇怪的是图像在本地淡入淡出,只有当我去发布服务器时才停止淡出.
只是想知道我是否遗漏了某些人可以迅速帮助我摆脱困境的事情.
这是发布服务器上的gcRotateContent,如果我只是抛出一个图像并执行淡入淡出它可以工作,由于某种原因它不适用于此标记.
<div class="gcRotateContent">
   <div id="USCFRR2EN" class="gcEmployeeProfile">
      <div class="gcEmployeeProfileHeading">
         Meet John</div>
      <div class="gcEmployeeProfileContent">
         <div class="gcEmployeeProfileHRPad">
         </div>
         <div class="gcEmployeeProfileHR">
         </div>
         <div class="gcEmployeeProfileHRPad">
         </div>
         <div class="gcEmployeeProfileSLVideo">
            <img src="/PublishingImages/Profile_JOHN-190x96.jpg" alt="Portrait of employee John."
               height="96" width="190"></div>
         <div class="gcEmployeeProfileName">
         </div>
         <div class="gcEmployeeProfileTitle">
            Software Development Lead, Server Performance</div>
         <div class="gcEmployeeProfileQuote">
            “You will find no other company with the sheer breadth of technologies. The things you get to see and learn from other
            people are amazing.”</div>
      </div>
      <div class="gcEmployeeProfileFooter">
      </div>
   </div>
</div>
<div class="gcRotate">
      <div class="gcRotateContent"> …我有一个带有动画的UIImageView,在UIView中,我应用了一个fadeIn效果,但我需要在触摸时动画的UIImageView应用淡出.
这就是我为淡入而做的.
UIView.animateWithDuration(0.5, delay: delay, 
    options: UIViewAnimationOptions.CurveEaseOut, animations: {
        uiImageView.alpha = 1.0
        }
我正在制作一个图片库应用程序.我目前有一个带有文本视图的imageview.目前它只是半透明的.我想让它淡入,等待3秒,然后淡出90%.引起关注或加载新图片将使其重复循环.我已经阅读了十几页,并尝试了一些事情,没有成功.我得到的只是淡入淡出并立即淡出
我有这个功能,适用于延迟加载.
panel.find('img[data-src]').each(function(){
            element = $(this);
            element.attr('src', element.data('src'));
            element.removeAttr('data-src');
如何fadeIn()对removeAttr函数产生影响?
我试过了:
element.removeAttr('data-src').fadeIn();
但它不起作用.该img代码看起来是这样的,我只是想在dot.png到淡出和淡入的original.jpg.
<img src="dot.png" data-src="original.jpg">
我想将一个fadeIn效果应用于addClass函数..并将fadeOut应用于removeClass ...
你能帮助我吗?
这是我的代码
$('#loader'+idTurno).addClass('loader');
...
$('#loader'+idTurno).removeClass('loader');
为什么在回调中无法删除元素$.fadeout?
例如,
$(".background-blackout").fadeOut('slow', function(){
    // Remove all the layer.
        $(this).remove();
}));
alert($('.background-blackout').length);
// return 1
这没有回调,
$(".background-blackout").fadeOut('slow', function(){
}).remove();
alert($('.background-blackout').length);
// return 0.
但它在元素完全淡出之前删除了元素.所以我想我应该remove()在几秒后打电话给你?
那我怎么能这样做remove()呢?
我试过这个,但不会删除图层,
$(".background-blackout").fadeOut('slow', function(){
});
setTimeout(function(){
    $(".background-blackout").remove(); 
},2000);
alert($('.background-blackout').length);
// returns 1.
我在演示VC中使用以下代码来淡化子模态VC,这很好用:
self.infoViewController.view.alpha = 0.0;
[self.navigationController presentModalViewController:self.infoViewController animated:NO];
[UIView animateWithDuration:0.5
             animations:^{self.infoViewController.view.alpha = 1.0;}];
但是我无法让它淡出,我尝试了一些东西,这是我尝试过的最新功能:
- (IBAction)dismissAction:(id)sender
{
if ([[self parentViewController] respondsToSelector:@selector(dismissModalViewControllerAnimated:)])
{
    [[self parentViewController] dismissModalViewControllerAnimated:YES];
    self.parentViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    self.parentViewController.view.alpha = 0.0;
    [UIView animateWithDuration:0.5
                     animations:^{self.parentViewController.view.alpha  = 1.0;}];
} else 
{
    [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];
    self.presentedViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    self.presentedViewController.view.alpha = 0.0;
    [UIView animateWithDuration:0.5
                     animations:^{
                         self.presentedViewController.view.alpha  = 1.0;}];
}
}
模态视图控制器淡出但立即消失,而不是像显示时那样.