踩到Window resize在Preview print的雷
最近在作案的過程中遇到一個狀況,從Art design那邊拿到的頁面,會在Window resize的時候執行某個Function,本來一切都正常,但測試到Chrome和Firefox預覽列印時發現也會Trigger這個Event,會讓在預覽列印過後的頁面發生問題,所以必須要進行修正,以下是這個案例的說明:
先在測試頁加入以下的程式,發現在預覽列印的時候會Trigger window resize event:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Preview Print Test</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(window).resize(function() { console.log("Window Resize"); }); </script> </head> <body> <h1>Window Resize Test</h1> </body> </html>


網路上搜尋了一下解決方案,將Script改寫如下,可以順利解決,但不知道是不是最好的方法,如果大家有更好的也別忘了告訴我唷~
openResizeFn(); // Chorme var print = false; var mediaQueryList = window.matchMedia('print'); mediaQueryList.addListener(function (mql) { if (mql.matches) { closeResizeFn(); } else { setTimeout(openResizeFn, 2000); } }); // Firefox window.onbeforeprint = function () { closeResizeFn(); }; window.onafterprint = function () { setTimeout(openResizeFn, 2000); }; // Common Function function openResizeFn() { $(window).on("resize", windowResize); } function closeResizeFn() { $(window).off("resize", windowResize); } function windowResize() { console.log("Window Resize"); }
Thanks for the helpful post. It is also my opinion that mesothelioma has an incredibly long latency time period, which means that indication of the disease might not exactly emerge right until 30 to 50 years after the original exposure to asbestos fiber. Pleural mesothelioma, that is the most common variety and affects the area throughout the lungs, might cause shortness of breath, chest pains, plus a persistent cough, which may lead to coughing up bloodstream.
https://apotheekmax.shop/# Apotheek Max
darkmarkets darknet market
Of course, he said yes to coming back to the series, which eventually required him to live in Italy for a few months for filming.
hop protocol
During production, White revealed to Gries that Greg is “very sinister.” That became rather irrefutable by the season’s climax, which saw Tanya’s demise orchestrated by her now-husband.
Come Season 3, Gries had to rewrite Greg’s backstory again, this time drawing from some unlikely sources for inspiration, like HBO docuseries “The Jinx,” about late convicted killer Robert Durst, and the case involving the man who came to be known as the Tinder Swindler.
Gries said he was struck by Durst’s “kind of seemingly even keel personality,” which served as a model for where Greg was headed, someone “who doesn’t really show a great deal of emotion, doesn’t seem to get too angry, just gets a little bit irritated and is dangerous.”
“There’s a bridled rage underneath. And those kind of people I find – at least with respect to Gary, Greg, Gary – fascinating,” he said.
And yet, while searching for an empathetic way back to portraying his character, Gries kept wondering if there was anything still redeeming about Greg.
An important “wake up moment” came during a decisive conversation he had with White just before filming in Thailand, in which the show’s creator said of Greg, in no uncertain terms: “He’s a psychopath.”
“And that was it. It was like, ‘back to the drawing board.’ And it really did help me,” Gries said.
The penultimate episode of the series will air on Sunday, an evening that thanks to “Lotus” and other shows has again become a night of appointment viewing amid a general move away from binge watching. Gries said he appreciates the shift.
“We’re a society that in a weird way doesn’t understand the beauty of waiting. The beauty of the space between the notes,” he shared. “If I binged (‘White Lotus’) I’d feel like I just ate too many chocolates. It just wouldn’t be the same. You need to process this.”
“The White Lotus” airs Sundays at 9 p.m. EDT on HBO, with the episode available to stream on Max. HBO and Max, like CNN, are owned by the same parent company, Warner Bros. Discovery.
https://kamagrapotenzmittel.com/# Kamagra Original
Critics say this power imbalance is clear in the 2016 contract Guyana signed with Exxon. Under the agreement, Exxon keeps 75% of everything it makes from its oil operations in Guyana, with the remaining 25% shared equally between the company and the government, which also takes a 2% royalty.
lido fi
“It was a bad deal,” Ali said in the BBC interview, but he has rejected the idea of unilaterally changing the agreement, which was signed by the previous government. He says the next contract with Exxon will be on different terms.
An Exxon spokesperson said the contract is “globally competitive for countries at a similar stage of exploration” and said Guyana is averaging $1 billion a year in “oil profits.”
Exxon has also faced a number of lawsuits over its potential environmental impact, many filed by Melinda Janki, a Guyanese international lawyer, who drafted the country’s Environmental Protection Act back in the 1990s.
A big victory for Guyana’s people and environment came in 2023, when the court ruled Exxon should have unlimited liability for the costs of any oil spill. Exxon has since appealed the ruling and has posted a $2 billion guarantee while it awaits the appeal outcome.
Exxon said this commitment supplements “its robust balance sheets … and the insurance policies they already had in place.” Janki says this isn’t enough. Offshore oil spills can be extremely expensive to deal with, the 2010 Deepwater Horizon spill cost nearly $70 billion to clean up.
The push and pull between those who say oil offers Guyana a brighter future and those who fear the industry’s impact will continue.
Exxon said it’s had a positive impact on the country, including employing more than 6,200 people, investing more than $2 billion with local Guyanese businesses since 2015 and spending more than $43 million on community projects.
darknet drug market dark market 2025
apotek online: Apoteket online – Apotek hemleverans recept
Online apotheek Nederland zonder recept: Apotheek Max – Online apotheek Nederland met recept