Jump to content

CSS in a GUI


 Share

Recommended Posts

Hi i'm beginner with AutoIT, and i'm looking to understand why I can't use this line in HTML/CSS in my GUI : "animation: marquee 7s linear infinite;"

Because nothing appears, I try with "_IEDocInsertHTML", same result..

CSS :

            .marquee p {
    
                font-size: 50px; 
                display: inline-block; 
                padding-left: 100%; 
                animation: marquee 7s linear infinite; 
            }
            
            @keyframes marquee {
            
                0%   { transform: translate(0, 0); }
                100% { transform: translate(-100%, 0); }
            }
  

Script :         

#include <IE.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

$url = "C:\Users\33782\Desktop\AutoIT\HTML\marqueegui.html"

 

$IE = _IECreateEmbedded()

GUICreate("", $DesktopHeight/2, $DesktopWidth, -1, 0, $WS_POPUP)
$IEobject = GUICtrlCreateObj($IE, -1, -1, @DesktopWidth, @DesktopHeight)
GUISetState(@SW_SHOW)


_IENavigate($IE, $url)

$testText = '<body><div class='&'"'&'marquee'&'">'&'<p>Marquee here</p></div></body></html>
$test = _IETagNameGetCollection($IE, "body", 0)
_IEDocInsertHTML($test, $testText, "beforeend")

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit

    Sleep(100)
WEnd
 

    

Link to comment
Share on other sites

... more or less something like this :

#include <IE.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

; $url = "C:\Users\33782\Desktop\AutoIT\HTML\marqueegui.html"

$IE = _IECreateEmbedded()

GUICreate("", @DesktopWidth, 90, 0, 0, $WS_POPUP)
$IEobject = GUICtrlCreateObj($IE, 0, 0, @DesktopWidth, 90)
GUISetState(@SW_SHOW)


_IENavigate($IE, "about:blank") ; $url)
Local $testText = _
        "<!DOCTYPE HTML>" & @CRLF & _
        "<html>" & @CRLF & _
        "<head>" & @CRLF & _
        " <meta http-equiv=""X-UA-Compatible"" content=""IE=edge"" />" & @CRLF & _
        " <style style='text/css'>" & @CRLF & _
        " .marquee p {" & @CRLF & _
        "    position: absolute;" & @CRLF & _
        "    width: 100%;" & @CRLF & _
        "    height: 100%;" & @CRLF & _
        "    margin: 0;" & @CRLF & _
        "    text-align: center;" & @CRLF & _
        "    font-size: 50px; " & @CRLF & _
        "    display: inline-block; " & @CRLF & _
        "    padding-left: 100%; " & @CRLF & _
        "    animation: marquee 15s linear infinite; " & @CRLF & _
        "    }" & @CRLF & _
        " @keyframes marquee {" & @CRLF & _
        "     0%   { transform: translate(0, 0); }" & @CRLF & _
        "     100% { transform: translate(-100%, 0); }" & @CRLF & _
        " }" & @CRLF & _
        "</style>" & @CRLF & _
        "</head>"

$testText &= '<body><div class="marquee"><p>Marquee here</p></div></body></html>'
; $test = _IETagNameGetCollection($IE, "body", 0)
; _IEDocInsertHTML($test, $testText, "beforeend")

$IE.document.Write($testText) ; inject lising directly to the HTML document:
$IE.document.close() ; close the write stream
$IE.document.execCommand("Refresh")

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit

    Sleep(100)
WEnd

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...